docker-compose

Docker compose and external images multi-stage builds

丶灬走出姿态 提交于 2019-12-06 02:45:22
I use Docker multi-stage build , specifically: Use an external image as a “stage” When using multi-stage builds, you are not limited to copying from stages you created earlier in your Dockerfile. You can use the COPY --from instruction to copy from a separate image, either using the local image name, a tag available locally or on a Docker registry, or a tag ID. The Docker client pulls the image if necessary and copies the artifact from there. The syntax is: In my case I have three Docker files. One Dockerfile simply defines an image, which I use as a build stage to share among two other

Docker postgres does not run init file in docker-entrypoint-initdb.d

梦想的初衷 提交于 2019-12-06 02:42:16
问题 Based on Docker's Postgres documentation, I can create any *.sql file inside /docker-entrypoint-initdb.d and have it automatically run. I have init.sql that contains CREATE DATABASE ronda; In my docker-compose.yaml , I have web: restart: always build: ./web expose: - "8000" links: - postgres:postgres volumes: - /usr/src/app/static env_file: .env command: /usr/local/bin/gunicorn ronda.wsgi:application -w 2 -b :8000 nginx: restart: always build: ./nginx/ ports: - "80:80" volumes: - /www/static

Docker tomcat editing configuration files through dockerfile

对着背影说爱祢 提交于 2019-12-06 02:36:54
问题 I have created a dockerfile and docker-compose like below, which is suppost to create an image of tomcat inside my container and edit the tomcat users so that I am able to access the manager gui. The four files below are all in the same folder as where I run the docker-compose up command. docker-compose.yml version: '2' services: tomcat: build: . container_name: development ports: - 8001:8080 environment: - spring.profiles.active=development Dockerfile FROM tomcat COPY tomcat-users.xml /usr

NodeJS Mongodb in docker compose = ECONNREFUSED

那年仲夏 提交于 2019-12-06 02:36:38
问题 I try to up a Node.JS container linked with a MongoDB container by docker-compose, but systematically node.js return an ECONNREFUSED error. The error nodejs_1 | /code/node_modules/mongoose/node_modules/mongodb/lib/server.js:228 nodejs_1 | process.nextTick(function() { throw err; }) nodejs_1 | nodejs_1 | Error: connect ECONNREFUSED nodejs_1 | at exports._errnoException (util.js:746:11) nodejs_1 | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19) NodeJS code var db = 'mongodb:/

How to link from docker-compose to Amazon RDS

你。 提交于 2019-12-06 02:04:48
问题 My docker-compose.yml looks something like this: django: build: . user: django links: # LINK TO AMAZON RDS? command: /gunicorn.sh env_file: config/settings/.env nginx: build: ./compose/nginx links: - django ports: - "0.0.0.0:80:80" How do I link the django container to the Amazon RDS, which has an url like: example.blahblahblah.eu-west-1.rds.amazonaws.com:5432 回答1: In that case, you don't have to define a "link"; the database service is already running, so all you need to do, is configure

IBM Bluemix erroring when creating volumes via docker-compose up

情到浓时终转凉″ 提交于 2019-12-06 01:43:05
I am currently trying to get a docker-compose.yml working with Bluemix. The docker-compose.yml works fine when used directly with docker. Here the error message: $ docker-compose -f docker-compose-bluemix.yml up -d Creating volume "angularexpress_iib-binary" with default driver Creating angularexpress_iib-binary_1 ERROR: "angularexpress_iib-binary" I have created the volumes manually to see if it would help, but still getting the same error message: $ cf ic volume list iib iib-binary The relevant sections in the docker-compose-bluemix.yml are as follows: version: '2' services: iib: iib-binary:

NodeJS + Mysql with Docker Compose 2

故事扮演 提交于 2019-12-06 01:31:34
问题 I´m trying to built a docker-compose file to deploy locally my NodeJS app that connects to a mysql server. I´ve tried everything ( read a lot of tutorials and some questions here in Stackoverflow ) but I keep getting the ECONNREFUSED error. This is my Dockerfile from NodeJS: ##Nodejs FROM node:latest RUN useradd --user-group --create-home --shell /bin/false app ENV HOME=/home/app COPY package.json npm-shrinkwrap.json $HOME/playerground/ RUN chown -R app:app $HOME/* USER app WORKDIR $HOME

Configure PyCharm interpreter with docker-compose inside Vagrant

走远了吗. 提交于 2019-12-06 01:15:00
I have a basic vagrant box, with docker and docker-compose running in it. The docker-compose.yaml has a web service like this: web: restart: always build: . ports: - "5000:5000" expose: - "5000" links: - postgres:postgres volumes: - .:/usr/src/app/ env_file: .env command: python manage.py runserver #below the postgres service is defined Vagrantfile: Vagrant.configure(2) do |config| config.vm.box = "phusion/ubuntu-14.04-amd64" config.vm.network "private_network", ip: "192.168.33.69" config.vm.synced_folder ".", "/vagrant_data" # provisioning The web service uses a Dockerfile with content: FROM

如何使用 Docker 组件开发 Django 项目?

倾然丶 夕夏残阳落幕 提交于 2019-12-06 00:50:20
Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。自2013年发布以来,无论是从 Github 上的代码活跃度,还是 Redhat 在 RHEL6.5 中集成对 Docker 的支持, 就连 Google 的 Compute Engine 也支持 Docker 在其之上运行。火热程度可见一斑! 本篇文章详细介绍了如何通过 Docker Machine 「系统配置」和 Docker Compose 「多容器应用组装」 提供堆栈完成 Postgres, Redis 和 Django 项目相结合的开发。 而在最后,该堆栈将包括如下每个服务的单独的容器: 一个 Web/ Django 的容器 一个 Nginx 的容器 一个 Postgres 的容器 一个 Redis 的容器 一个 Data 容器 ##本地设置 使用 Docker「v1.6.1」版本我们将使用到 Docker Compose 「v1.2.0」编排一个多容器组成的应用程序,使用 Docker Machine「v0.2.0」创建本地和云的 Docker 主机。 按照指示,分别安装 Docker Compose 和 Machine,然后测试安装结果: $ docker-machine --version docker

Docker compose postgresql service - can't create user and database during build?

心不动则不痛 提交于 2019-12-06 00:34:13
问题 I have wasted an entire day on this, and to say I'm not impressed by the unnecessary complexity of what should be a simple task - would be a gross understatement. Ok, having got that off my chest, I am building a django application using docker-machine, docker-compose, postgresql and redis - by following this tutorial. I have managed to get the basic tutorial to work - but it does not suit my needs, as I need to create a user and a database for my application - as opposed to using 'postgres'