docker-compose

How to do variable substitution in env_file?

吃可爱长大的小学妹 提交于 2019-12-10 13:39:04
问题 I am using docker-compose and I want my env_file to have variable subsitution. I would like to define one variable in the file and then use it in other variables: APP_ENV=dev-foo LOCALPATH=/tmp/builddir/${APP_ENV} GIT_URL=git@github.com:some-org/${APP_ENV} What is the supported form of variable substitutions in env_file??? 回答1: Variable substitution is not supported in env_file. Your options are: use variables in the environment: section (although you wont be able to do your example because

Getting invalid mount config for type “bind”: bind source path does not exist in docker

孤人 提交于 2019-12-10 13:33:28
问题 I am trying to deploy following docker-compose into docker swarm cluster. version: '3.2' services: jenkins: image: jenkins/jenkins:lts ports: - 8080:8080 volumes: - ./data_jenkins:/var/jenkins_home deploy: mode: replicated replicas: 1 I do have the data_jenkins in the same locations where docker-compose is and passing that path as volume . But why is it throwing the source path does not exist. What exactly is the problem. Also if the directory doesnot exist -v should have created it right.

Docker - Can't access Django server

扶醉桌前 提交于 2019-12-10 13:25:53
问题 I can not connect to django through the port in the container. I'm using this address: 0.0.0.0.:8000 and see: http://joxi.ru/Dr8MeGLhkBWnLm. I'm creating an image and a container with one command: 'docker-compose up -d'. $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4fea50856eef docker_web "python manage.py ru…" 13 seconds ago Up 11 seconds 0.0.0.0:8000->8000/tcp docker_web_1 docker-compose.yaml version: '3' services: web: build: context: . dockerfile: /django.testsite

docker-compose: no gunicorn when trying “up” container

早过忘川 提交于 2019-12-10 13:11:17
问题 I'm facing with issue when I try to "up" my container on DigitalOcean env. I have Ubuntu Docker 1.7.1 on 14.04 as env droplet. There is the next error. mysite | ./docker-entrypoint: line 8: exec: gunicorn: not found This is my Dockerfile where I tried to add gunicorn setup by (apt-get, pip). Sadly but it doesn't work I have the same issue with missed gunicorn module. Dockerfile FROM python:2.7.7 RUN curl -sL https://deb.nodesource.com/setup | bash - RUN apt-get -y install nodejs RUN apt-get

Docker healthcheck in composer file

北战南征 提交于 2019-12-10 13:08:39
问题 I try to integrate the new healthcheck into my docker system, but I don't really know how to do it in the right way :/ The problem is, my database container needs more time to start up and initialize the database then the container who starts my main application. As a result: the main container wont start correct, cause of the missing database connection. I wrote an healthcheck.sh script to check the database container for connectivity, so the main container starts booting after the

Docker compose - share volume Nginx

假装没事ソ 提交于 2019-12-10 12:39:34
问题 I just want to test Docker and it seems something is not working as it should. When I have my docker-compose.yml like this: web: image: nginx:latest ports: - "80:80" when in browser I run my docker.app domain (sample domain pointed to docker IP) I'm getting default nginx webpage. But when I try to do something like this: web: image: nginx:latest volumes: - /d/Dev/docker/nginx-www/nginx/html/:/usr/share/nginx/html/ ports: - "80:80" when I run: docker-compose up -id when I run same url in

Download dependencies given only the build.gradle file

随声附和 提交于 2019-12-10 11:17:19
问题 Is it possible to download gradle dependencies using only build.gradle file? What I am trying to accomplish is the following: I have a set of unit tests and I want to execute them (as part of CI process) inside a docker container. Initially, I used the openjdk:8-jdk image from docker hub as base image for my tests. So, docker compose file contains the following: version: '3.2' services: unit: image: openjdk:8-jdk volumes: - ..:/usr/test working_dir: /usr/test command: sh -c "exec ./gradlew

How do I run migrations in Dockerized Django?

孤街醉人 提交于 2019-12-10 11:06:49
问题 I followed a Docker + Django tutorial which was great, in that I could successfully build and run the website following the instructions. However, I can't for the life of me figure out how to successfully run a database migration after changing a model. Here are the steps I've taken: Clone the associated git repo Set up a virtual machine called dev with docker-machine create -d virtualbox dev and point to it with eval $(docker-machine env dev) Built and started it up with: docker-compose

How to get contents generated by a docker container on the local fileystem

泄露秘密 提交于 2019-12-10 10:53:44
问题 EDIT : I'm not longer using docker so I'll not be able to test answers to this question thanks to all for the suggestions! TL;DR: can you point me to a simple example of an image that writes changes to a volume shared between the container and the host filesystem? Hi, I have some trouble understanding how volumes work. I've read the Dockerfile reference and also understanding volumes What I'm trying to do I have an image that makes a composer installation of wordpress on RUN to /var/tmp/html

Export environment variables from Makefile to userland environment

被刻印的时光 ゝ 提交于 2019-12-10 10:48:26
问题 I'm looking how to export from a Makefile environment variables to be exposed in the userland environment so exporting these variables from the Makefile should be accessible from the user shell. I have tried make's export but as I understand and have tried does not export to outside of Makefile. The idea of this is to populate Docker Compose environment variables in a elegant way and have these variables ready to use in the user shell also. This is a fragment of what I've tried with make's