Tag: docker docker

我怎样才能让我的nodeJS容器连接到我的mongoDB容器?

我有两个相当简单的Docker容器,一个包含一个NodeJS应用程序,另一个只是一个MongoDB容器。 Dockerfile.nodeJS FROM node:boron ENV NODE_ENV production # Create app directory RUN mkdir -p /node/api-server WORKDIR /node/api-server # Install app dependencies COPY /app-dir/package.json /node/api-server/ RUN npm install # Bundle app source COPY /app-dir /node/api-server EXPOSE 3000 CMD [ "node", "." ] Dockerfile.mongodb FROM mongo:3.4.4 # Create database storage directory VOLUME ["/data/db"] # Define working directory. […]

服务“networking”未能build立:lstat apache / sites-enabled / 000-default.conf:没有这样的文件或目录

我要 # Update the default apache site with the config we created. COPY ./apache/sites-enabled/000-default.conf /etc/apache2/sites-enabled/000-default.conf 我知道我的000-default.conf与Dockerfile不在同一个目录,这就是为什么我想打这样./apache/…但我仍然有错误。 结构体: dockerizing-django ├── apache │ └── sites-enabled │ └── 000-default.conf ├── docker-compose.yml ├── production.yml ├── README.md └── web ├── docker_django │ ├── __init__.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── Dockerfile ├── manage.py └── requirements.txt 和Dockerfile: […]

docker工人 – 一个Dockerfile和docker-compose.yml上的多个项目

我从Docker开始,在我看来非常棒! 现在我正在寻找这个组织的解决scheme: 现在我有这样的结构: Applications | +–app1 | | +–node_modules | | +–package.json | | +–… | +–app2 | | +–node_modules | | +–package.json | | +–… | …. | docker-compose.app1.yml | docker-compose.app2.yml | …. | Dockerfile //my personalized image for all projects 但是我想达到这个: Applications | +–app1 | | +–node_modules //empty in host | | +–package.json […]

Docker Cloud自动testing找不到服务

我目前正在试图dockerize我的一个Django API项目。 它使用postgres作为数据库。 我使用Docker Cloud作为CI,以便可以构build,皮棉和运行testing。 我从下面的DockerFile开始 # Start with a python 3.6 image FROM python:3.6 ENV PYTHONUNBUFFERED 1 ENV POSTGRES_USER postgres ENV POSTGRES_PASSWORD xxx ENV DB_HOST db RUN mkdir /code ADD . /code/ WORKDIR /code RUN pip install -r requirements.txt RUN pylint **/*.py # First tried running tests from here. RUN python3 src/manage.py test 但是这个DockerFile总是失败,因为在运行unit […]

在docker容器中configuration应用程序以访问其他容器

如何configuration部署为泊坞窗容器的应用程序来引用在其他容器中运行的组件? 我有一个需要postgresql的节点应用程序。 我有一个节点configuration文件,其中包含postgres的所有连接信息。 在非docker部署中,只需设置所需的configuration值(例如db服务器的IP地址等),但是如何在docker部署中完成此操作? 我使用的是Docker Compose,但是看不到如何findpostgres docker容器的必要IP地址,然后在我的node.jsconfiguration中设置该值。

我应该给tomcat通过源代码Docker卷连接的redis容器的ip地址

我是docker工的初学者。 我的源代码在xyz卷内有一个属性文件,我必须提及redis的ip地址和密码。 这里tomcat无法连接到redis这是我的docker-compose.yml version: "2" services: tomcat: container_name: tomcat build: ./tomcat ports: – "8080:8080" env_file: – ./tomcat/tomcat.env networks: – srikant-network environment: – COMPOSE_HTTP_TIMEOUT=200 volumes: – /opt/xyz:/opt/xyz depends_on: – redis – mysql – elasticsearch redis: container_name: redis build: ./redis ports: – "6379" environment: requirepass: password networks: – srikant-network elasticsearch: container_name: elasticsearch build: ./elasticsearch ports: – "9300:9300" […]

Docker用于embedded式设备

我已经是docker用户,我基本上使用docker运行服务器。 我从学校里得到了一个大项目,这个项目的目标是开发一个像Google Home一样的连接设备,但是更简单,也适合孩子们的使用:),我们有很多的库安装在我们的linux软件上,讨厌手动安装库或sh脚本。 所以,我想知道是否可以使用docker image来安装一次库,就像创build一个自定义转储一样,因此组中的每个成员只需创build映像并运行容器。 就像Linux“准备使用”一样。 当这个想法来到我这里,这显然是显而易见的,但实际上我们需要声音和video回来。 对于audio,我们发现,但我们需要驱动程序的video,几乎没有关于这个文件。 你认为docker是解决问题的好select吗? 现在是否存在更好的解决scheme? 预先感谢您的build议。

泊坞窗:谷歌表最小的例子错误

我有一个烧瓶的应用程序,从谷歌表中提取一些数据。 当我在本地机器上运行烧瓶应用程序时,最初它是通过0auth2validation创build证书并将其存储在本地。 在本地应用程序成功完成之后,我在Docker容器中创build了相同的应用程序。 情况1 该容器具有在创build容器时复制/添加的凭证。 在这种情况下,烧瓶应用程序没有任何问题 情景2 该容器目前没有凭证文件。 所以,它必须通过调用get_credentials()函数来生成文件。 此时,网页浏览器停留在等待服务器的响应(浏览器处于加载阶段) 情况2是问题。 希望可以有人帮帮我 .. 我正在关注这个文档 。 Dockerfile FROM python:2.7-slim WORKDIR g_api ADD . /g_api RUN pip install -r requirements.txt EXPOSE 8000 泊坞窗,compose.yml version: "3" services: web: build: context: . dockerfile: Dockerfile command: "python g_api.py" ports: – "8000:8000" networks: – webnet volumes: – .:/g_api networks: webnet: requirements.txt […]

docker-为nodeJS上的Postgres组成ECONNREFUSED

这个错误与ECONNREFUSED相同。 但是执行方式不同,我会在这里再提一个问题。 这是docker-compose.yml文件 version: '3' services: server: build: context: . volumes: # Mounts the project directory on the host to /app inside the container, # allowing you to modify the code without having to rebuild the image. – .:/app # Just specify a path and let the Engine create a volume. # Data present in […]

用Dockerrun.aws.json和Elastic Beanstalk命名一个Docker容器

我需要在EB应用程序上执行后期部署脚本。 我需要在多容器Docker环境中的Docker容器上执行命令。 问题是Docker容器被分配了一个随机的哈希值作为容器名称。 我已经四处search,似乎无法find任何信息,您可以在EB的构build和设置过程中,如何分配名称到Docker容器。 有没有人有任何见解呢? 我知道与docker,撰写这不是一个问题。