docker-compose

Access named volume from container when not running as root?

蹲街弑〆低调 提交于 2019-12-06 08:20:32
问题 I'm running Celery under Docker Compose. I'd like to make Celery's Flower persistent. So I do: version: '2' volumes: [...] flower_data: {} [...] flower: image: [base code image] ports: - "5555:5555" volumes: - flower_data:/flower command: celery -A proj flower --port=5555 --persistent=True --db=/flower/flower However, then I get: IOError: [Errno 13] Permission denied: 'flower.dat' I ran the following to elucidate why: bash -c "ls -al /flower; whoami; celery -A proj flower --persistent=True -

Communication between linked docker containers

只愿长相守 提交于 2019-12-06 07:26:53
I have two docker containers in the following setup on a host machine: Container 1 - UDP Port 5043 is mapped to host port 5043 (0.0.0.0:5043:5043) Container 2 - Needs to send data to Container 1 on port 5043 as UDP. Scenario 1 I start Container 1 and obtain it's IP address. I use this IP address and configure Container 2 with it and start it. Container 2 is able to send UDP data to Container 1 by calling udp://Container_1_IP:5043 EVERYTHING WORKS!! Scenario 2 I start Container 1 by mapping 5043 UDP port to host's 5043 port ( 0.0.0.0:5043:5043 ) I link Container 2 and Container 1 using ' -

PHP cannot write in docker container

拥有回忆 提交于 2019-12-06 06:49:21
I'm trying to create a workflow in docker. It's simple: just PHP and MySQL to little tests. My docker-compose.yml : web: build: .docker links: - mysql:mysql ports: - "80:80" - "443:443" volumes: - ./public_html:/var/www/html mysql: image: mysql:5.7 environment: - MYSQL_ROOT_PASSWORD=root volumes: - "./.data/db:/var/lib/mysql" phpmyadmin: image: phpmyadmin/phpmyadmin ports: - "8080:80" links: - mysql:mysql environment: - PMA_HOST=mysql volumes: - /sessions And my Dockerfile : FROM php:5.6-apache RUN docker-php-ext-install mysqli It's all ok: I can up containers but PHP itself cannot write in

Run command from one container to another

时光总嘲笑我的痴心妄想 提交于 2019-12-06 06:35:47
问题 I have two dockerized projects: one using NodeJS and the other one using Python I want to trigger a Python script execution (on the container with the Python app) from the NodeJS app. Basically the NodeJS app would run something like exec('python3 script.py') , but it's expected to be run on the Python app container. How can I achieve this exact behavior? Thanks in advance! 回答1: Docker containers are an implementation of the micro-service architecture. As such, they are expected to be fairly

Spring Boot, PostgreSQL, and Docker - Connection Refused whil Running in Container

旧街凉风 提交于 2019-12-06 06:32:25
I am attempting to build a "service" consisting of a Spring Boot application and PostgreSQL database. I have been able to access the database (running in a container) from the Spring Boot app while the Spring Boot application was running on my local machine. Now, when I attempt to move the Spring Boot application to a container, I am received the following error: inventory_1 | 2018-01-20 18:43:06.108 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested

Docker-compose external_links not able to connect

时光怂恿深爱的人放手 提交于 2019-12-06 06:11:22
问题 I have a couple of app containers that I want to connect to the mongodb container. I tried with external_links but I can not connect to the mongodb. I get MongoError: failed to connect to server [mongodb:27017] on first connect Do I have to add the containers into the same network to get external_links working? MongoDB: version: '2' services: mongodb: image: mongo:3.4 restart: always ports: - "27017:27017" volumes: - data:/data/db volumes: data: App: version: '2' services: app-dev: restart:

Can not find docker container

此生再无相见时 提交于 2019-12-06 06:00:57
问题 I have asp core api project and i am using visual studio 2017 to run my project. After i renamed the docker container that was previously created using visual studio using this command on command line, docker rename CONTAINER NEW_NAME I receive the following message when i try to run the project again in visual studio. Thanks for the help Can not find docker container with the name starting with 'previous_container_name'. 回答1: Delete the .vs folder in your solution directory (close the

Docker: How to copy a file from one folder in a container to another?

半城伤御伤魂 提交于 2019-12-06 05:53:41
I want to copy my compiled war file to tomcat deployment folder in a Docker container. As COPY and ADD deals with moving files from host to container, I tried RUN mv /tmp/projects/myproject/target/myproject.war /usr/local/tomcat/webapps/ as a modification to the answer for this question . But I am getting the error mv: cannot stat ΓÇÿ/tmp/projects/myproject/target/myproject.warΓÇÖ: No such file or directory How can I copy from one folder to another in the same container? A better solution would be to use volumes to bind individual war files inside docker container as done here . Why your

How to redirect http to https with Traefik 2.0 and Docker Compose labels?

独自空忆成欢 提交于 2019-12-06 05:50:53
问题 Please note that it is a Traefik V2 question. I had a solution on V1 but V2 is a total rewamp. This above is supposed to redirect http://whoami.mysite.com to http s ://whoami.mysite.com. The http s is working nicely. The http don't redirect to https and raise an error 404. There is no other file. All is in this Docker-compose.yml for the moment since it is a test to prepare further deployement. version: "3.3" services: traefik: image: "traefik:v2.0" container_name: "traefik" command: - "--log

How to use Deployer with Docker (Laradock)

青春壹個敷衍的年華 提交于 2019-12-06 05:07:51
I created a fresh Digital Ocean server with Docker on it (using Laradock ) and got my Laravel website working well. Now I want to automate my deployments using Deployer . I think my only problem is that I can't get Deployer to run docker exec -it $(docker-compose ps -q php-fpm) bash; , which is the command I successfully manually use to enter the appropriate Docker container (after using SSH to connect from my local machine to the Digital Ocean server). When Deployer tries to run it, I get this error message: ➤ Executing task execphpfpm [1.5.6.6] > cd /root/laradock && (pwd;) [1.5.6.6] < /root