Tag: dockerfile

Elastic Beanstalk上的Node Docker容器找不到本地Gulp

我正在尝试部署一个单一的docker容器弹性beanstalk和我的运行命令gulp gulp production && node server.js 。 Docker不断抛出错误Local gulp not found in /app/user … try running npm install gulp 。 我已经尝试列出我的package.json文件中的gulp作为depDependecy和devDependecy,但是这并不能解决问题。 我也试图在我的Dockerfile中全局安装gulp。 有人能告诉我我的设置有什么问题吗? 这是我的文件: Dockerfile FROM node:6.5.0 # Internally, we arbitrarily use port 3000 ENV PORT 3000 # Create some needed directories RUN mkdir -p /app/user/ WORKDIR /app/user/ # setup path ENV PATH /app/user/node_modules/.bin:$PATH RUN […]

独立的开发和生产实例和数据库

我有一个托pipe在服务器上的Web应用程序,它使用virtualEnv来分隔dev和prod实例。 两个实例共享相同的postgres数据库。 (全部在同一台服务器上) 我是一个新的docker,我想用docker容器replacedev和prod实例,并且每个链接到dev或prod postgres容器(或者类似的效果,以便在开发中更改代码不会影响生产数据库。 ) 什么是这种情况下最好的devise? 我应该将dev和prod容器映射到不同的端口吗? 我可以有dever和prod容器的1个dockerfile吗? 我如何处理2个postgres容器?

什么是一步一步的过程将一个Java应用程序部署到Docker?

我的工程背景主要是编码/ dev't比部署。 我们最近向我们的团队介绍了微服务,我正在做POC将这些微服务部署到Docker。 我用maven,Java 8(不是OpenJdk)做了一个简单的应用程序,并且准备好部署jar文件,但是我坚持如何在Docker容器上部署和运行/testing应用程序的确切步骤。 我已经在Mac上下载了Docker,并且检查了这个文档,但是我觉得中间有一些步骤丢失了,我感到困惑。 我恳求你的帮助。 谢谢!

DotNet构buildCLI在terminal中工作,但不在Docker构build中

这是我第一次尝试.net核心和docker。 我不知道什么是错的。 我可以在terminal运行dotnet restore / dotnet build / dotnet run ,没有任何问题。 该网站加载得很好。 所以我想给docker一个尝试(最终在云中的VM上运行)。 我运行docker build -t latest . 这导致: Step 5 : RUN dotnet build —> Running in e463aff85460 Project app (.NETCoreApp,Version=v1.0) will be compiled because project is not safe for incremental compilation. Use –build-profile flag for more information. Compiling app for .NETCoreApp,Version=v1.0 /app/project.json(32,58): error […]

安装davfs2卷时,无法在docker箱中打开保险丝装置

当我尝试在docker容器上安装davfs2卷时遇到以下错误: geoserver@8e8091d97157:~$ mount owncloud/ /sbin/mount.davfs: loading kernel module fuse /sbin/mount.davfs: loading kernel module fuse failed /sbin/mount.davfs: waiting for /dev/fuse to be created /sbin/mount.davfs: can't open fuse device /sbin/mount.davfs: trying coda kernel file system /sbin/mount.davfs: no free coda device to mount Dockerfile有以下内容: FROM debian:jessie ENV DEBIAN_FRONTEND noninteractive ENV TERM linux # environment variables ENV GEOSERVER_PASS geoserver […]

docker-compose不会从最新的git仓库提交构build镜像

我有一个git仓库(仓库有Dockerfile和docker-entrypoint.sh),我用它作为docker-compose构build的上下文: build: context: git@git.example.com/example/example-backend.git 当我运行以下任一项时: 1. docker-compose build && docker-compose up -d 2. docker-compose build –no-cache && docker-compose up -d 3. docker-compose up -d –build 该映像正在从存储库中构build,但是文件并不是最新的origin / master。 他们是从以前的承诺。 我检查了看是否从git拉实际上工作。 干 git clone git@git.example.com/example/example-backend.git 从最新的提交拉。 我究竟做错了什么? Docker无法从最新的git仓库中提交。

定义的Linux发行版中的哪些命令在Docker容器中可用?

我是docker的新手,明白linux内核是在主机操作系统和容器之间共享的。 但是我不太了解docker模拟一个特定的linux发行版。 假设我们有一个简单的docker文件,像这样: FROM ubuntu:16.10 RUN apt-get install nginx 它会给我一个在Ubuntu 16.10环境中安装nginx的docker容器。 所以我应该可以使用apt-get作为Ubuntu的默认包pipe理器。 但这有多深? 我可以假设那些像lsb_release这样的发行版的典型命令是像安装了Ubuntu 16.10的完整虚拟机一样被模拟的吗? 我的问题背后的原因是,Linux发行版是不同的。 我需要知道哪些命令是可用的,例如,当我运行一个Ubuntu 16.10的容器,就像在上面安装了不同的发行版的主机(如Red Hat,CentOS等)上运行一个容器一样。 Docker中的Ubuntu镜像约为150 MB。 所以我认为并不是所有的工具都包含在真实的安装中。 但是,我怎么知道我可以在哪个地方丢下他们呢?

Shell脚本来validationLinux上的docker安装

我想写一个shell脚本来validationdocker是否安装。 如果docker已安装: $ docker -v Docker version 1.7.0, build 0baf609 $ echo $? 0 如果docker没有安装: $ docker -v The program 'docker' is currently not installed. You can install it by typing: apt-get install docker $ echo $? 127 这是我的脚本: #!/bin/bash docker -v if echo $? = 128 ; then echo "The program 'docker' is currently […]

在NGINX docker容器中启动之前运行一个bash脚本

我正在尝试使用docker在localhost:8000上运行一个JavaScript应用程序。 部分我想做的是换出一些基于docker run命令的configuration文件,我想传递一个环境variables到容器中,以便bash脚本可以使用它作为参数。 我的dockerfile看起来是这样的: FROM nginx COPY . /usr/share/nginx/html CMD ["bash","/usr/share/nginx/html/runfile.sh"] 而bash脚本看起来像这样: #!/bin/bash if [ "$SECURITY_VERSION" = "OPENAM" ]; then sed -i -e 's/localhost/openam/g' authConfig.js fi docker run -p 8000:80 missioncontrol:latest -e SECURITY_VERSION="TEST" Docker给了我一个exception,说-e执行命令没有find。 但是,如果我更改dockerfile使用ENTRYPOINT而不是CMD,-e标志工作,但Web服务器不启动。 有什么我在这里失踪? 入口点被覆盖或什么的? 编辑: 所以我更新了我的dockerfile来使用ENTRYPOINT ["bash","/usr/share/nginx/html/runfile.sh", ";", " nginx -g daemon off;"] 但docker集装箱仍然closures。 有什么我失踪?

Docker在完成Golang项目构build之前退出

我正在尝试使用Docker来构build一个Golang项目,但是这个过程在它完成之前一直保持退出状态,下面是terminal输出的一部分: github.com/kataras/go-template (download) Fetching https://golang.org/x/crypto/acme/autocert?go-get=1 Parsing meta tags from https://golang.org/x/crypto/acme/autocert?go-get=1 (status code 200) get "golang.org/x/crypto/acme/autocert": found meta tag main.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto/acme/autocert?go-get=1 get "golang.org/x/crypto/acme/autocert": verifying non-authoritative meta tag The command '/bin/sh -c go get -v' returned a non-zero code: 1 我的Dockerfile看起来像这样: FROM golang:1.7 RUN mkdir -p $GOPATH/src/bitbucket.org/cram/rolldrove WORKDIR $GOPATH/src/bitbucket.org/cram/rolldrove COPY . $GOPATH/src/bitbucket.org/cram/rolldrove RUN go […]