这是我第一次使用Docker。 我正确地安装了它,并且守护程序服务正在运行,正如所说的那样。 所以,我有一个简单的networking应用程序与玩框架和Scala语言。 运行“sbt docker:publishLocal”之后,我得到了“构build的图像play-scala-book:1.0-SNAPSHOT”的成功。 我导出“DOCKER_HOST = tcp://192.168.0.8:2375”。 我built.sbt是>> // import NativePackagerKeys._ // setting a maintainer which is used for all packaging types maintainer := "Felipe Oliveira Gutierrez" // exposing the play ports dockerExposedPorts in Docker := Seq(9000, 9443) name := """play-scala-book""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayScala) scalaVersion := "2.11.7" […]
https://www.playframework.com/documentation/2.5.x/Deploying#The-Native-Packager 是否有可能用sbt-dockerreplace这个插件?
我正在Docker容器中运行Play Framework 2.5.x的开发环境。 该应用程序的工作原理,我可以通过共享端口在我的浏览器上查看它。 但是,自动更新function不起作用。 从研究中我了解到,这是因为Play的JNotify不会轮询共享文件夹中的文件更改。 我试过这个问题的解决scheme,这是简单的轮询在一个时间间隔通过添加以下build.sbt PlayKeys.fileWatchService := play.runsupport.FileWatchService.sbt(pollInterval.value) 做了这个改变(并确保它被推送通过共享文件夹),使用activator run成功编译并运行服务器。 [info] Done updating. — (Running the application, auto-reloading is enabled) — [info] pcsNettyServer – Listening for HTTP on /0:0:0:0:0:0:0:0:9000 (Server started, use Ctrl+D to stop and go back to the console…) 我可以在我的浏览器中查看它。 但是,在更改文件时,不会发生重新编译,刷新也不会改变任何内容。 停止并启动服务器,但确实显示更改。 我想我可能知道为什么,但我不知道如何解决它。 我读过使用activator ~run应该启动服务器,但使用SBT而不是激活。 当我使用这个命令启动服务器时,它挂在: [info] Set current project to […]
我有一个使用aerospike的应用程序 在application.conf我有一个参数,我可以从环境重写 aerospike.hosts = ["192.168.33.10"] aerospike.hosts = ${?DS_AEROSPIKE_HOSTS} 我可以如何设置我的泊坞窗撰写文件中的主机列表? version: '3.1' services: ds-aerospike-db: image: aerospike/aerospike-server restart: always volumes: – volume:/opt/aerospike/etc command: ["–config-file","/opt/aerospike/etc/aerospike.conf"] ports: – 3000:3000 dashboard: image: dashboard:0.1 restart: always ports: – 9000:9000 environment: DS_AEROSPIKE_HOSTS: '["192.168.33.10"]' 这个格式是错误的DS_AEROSPIKE_HOSTS:'[“192.168.33.10”]'
我使用sbt one-jar插件将我的Scala / LiftWeb应用程序打包到单个可执行jar文件中,并将其打包到Docker中,将Docker文件中的embedded式Jetty端口公开。 它在Docker上本地运行良好,并使用CLI部署工具在AWS EB上显式部署。 然而,在接收到的EB URL上,我看到的只是贵网页,上面写着:“您的Docker容器现在正在AWS Cloud中您自己的专用环境中运行在Elastic Beanstalk中。” 那么,我的应用程序在哪里? 我是否错过在我的EB实例上公开提供我的应用程序的任何步骤?
我使用sbt-native-packager从Scala应用程序构buildDocker镜像。 在结果图像中有两层相似的尺寸: docker history –no-trunc docker.example.com/scala-app … b49580a36beb6c7cd020ad006954f245aebf82041d3e79eff1517fdbf58ae6cd About an hour ago chown -R daemon:daemon . 125.2 MB f12b3a929ded4161044642e117114b57889613d77186a0a727862ab5a44af5e3 About an hour ago /bin/sh -c #(nop) ADD dir:678c325d24285ae96f682c6abc3d71cc8a17ee6267a2db4fff232fcaaa5dec13 in /opt 125.2 MB … 我假设这两层只在所有权上有所不同(chown -R守护进程:守护进程)。 问题是,他们都在下拉过程中被下载。 有没有办法将这两个图层合并为一个图像大小?
我有一个普通的项目(不玩),我想创build这个项目的docker图像….我怎么能做到这一点? 我尝试了这样的事情: dockerRepository := Some("docker-docker-local.artifactoryonline.com") dockerUpdateLatest := true dockerEntrypoint := Seq("bin/%s" format executableScriptName.value, "-J-Xms1024M", "-J-Xmx2048m", "-J-server") 但是dockerRepository , dockerUpdateLatest和dockerEntrypoint在我的dockerEntrypoint中不是家喻户晓,我需要导入一些东西,但是我不知道是什么。 我也有一个jfrog帐户来保存我的artifactory(这就是为什么我加了url)。 什么是最好的办法呢? thanksss!@
我有一个play scala应用程序,我通过AWS Elasticbeanstalk控制台将其作为通用Docker应用程序进行部署。 当我在本地运行应用程序时,我没有看到任何问题,所以我认为代码是正确的。 我需要有能力 将文件写入本地磁盘 在这些文件上运行一些命令行工具(如ffmpeg) 但是,我的应用程序不写入本地磁盘,也不让我执行命令行实用程序。 val localFile = new File(s"$localFilePath/$siteId/download/${fileName}.raw") s3Client.getObject(new GetObjectRequest(bucketName, summary.getKey), localFile) val cmd = s"ffmpeg -i ${localFile.getAbsolutePath} -vcodec copy ${localFile.getAbsolutePath}.mp4" cmd !; 这是我的Dockerrun.aws.json文件 {"AWSEBDockerrunVersion": "1","Logging": "/opt/docker/logs"} 更新更新我的Dockerrun.aws.json文件以包含卷映射 {"AWSEBDockerrunVersion": "1","Logging": "/opt/docker/logs","Volumes":[{"HostDirectory": "/tmp/files","ContainerDirectory": "/tmp/files"}]} 该应用程序正在编写本地文件,但由于某种原因无法运行ffmpeg。 Exception : Cannot run program "ffmpeg": error=2, No such file or directory
我正在尝试使用docker运行Scala应用程序。 我创build了一个具有以下结构的示例项目。 build.sbt name := "test" version := "1.0" scalaVersion := "2.12.2" 项目/ build.properties sbt.version = 0.13.15 的src /主/阶/ HelloWorld.scala object HelloWorld { def main(args: Array[String]): Unit = { println("Hello, world!") } } 现在,如果我sbt run ,一切工作正常,我有可爱的问候世界。 $ sbt run … [info] Set current project to test (in build file:/Users/yuchen/Documents/test/) [info] Running HelloWorld Hello, world! [success] […]
我想使用Jenkins的堆栈继续交付:Git Scala(SBT)Docker Jenkinsfile: pipeline { agent any stages { stage('Build') { steps { echo "Compiling…" sh "${tool name: 'sbt', type: 'org.jvnet.hudson.plugins.SbtPluginBuilder$SbtInstallation'}/bin/sbt compile" } } stage('Docker Publish') { steps { // Generate Jenkinsfile and prepare the artifact files. sh "${tool name: 'sbt', type: 'org.jvnet.hudson.plugins.SbtPluginBuilder$SbtInstallation'}/bin/sbt docker:stage" // Run the Docker tool to build the image script { […]