docker-compose

Docker Named Volume location Mac

吃可爱长大的小学妹 提交于 2019-12-07 18:08:36
问题 I'm using Docker for Mac 1.12.1 and have a docker compose file which starts wordpress and mysql services Compose file version: '2' services: db: container_name: mysql_db image: mysql:5.7 volumes: - "./.data/db:/var/lib/mysql" restart: always environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: container_name: wordpress depends_on: - db image: wordpress:latest links: - db ports: - "8000:80" restart: always environment:

Docker with Symfony 4 - Unable to see the file changes

爱⌒轻易说出口 提交于 2019-12-07 18:08:31
问题 I'm working on a docker image for dev environment for a Symfony 4 application. I'm building it on alpine , php-fpm and nginx . I have configured an application, but the performance was not great (~700ms) even for the simple hello world application, so I thought I can make it faster somehow. First of all, I went for semantics configuration and configured the volumes to use cached configuration. Then, I moved vendor to separate volume as it caused the most of performance issues. As a second

difference between localhost and postgres for host in docker

眉间皱痕 提交于 2019-12-07 18:06:27
I am developing a django app and trying to run it inside docker. I have an issue that I could not understand so far. while running the app with docker-compose , it seems that the web app cannot connect to the database when i use these configurations: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'my_db', 'USER': 'my_user', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '5432', } but once I change the host to postgres , it works. like this DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'my_db', 'USER': 'my_user',

docker-compose assign lan ip to service

∥☆過路亽.° 提交于 2019-12-07 18:03:25
问题 I have three containers connected with docker-compose, all together in a docker internal network. But I would like to expose one of the containers by assigning to it a LAN IP. So, I have the host pointed by the IP: 192.168.220.33 and I would like to assign to the gitlab container the IP: 192.168.220.220. My problem right now is that I am getting this error: ERROR: for gitlab Cannot start service gitlab: invalid link local IP address: 192.168.220.220 I am using docker-compose 1.11.2 and I have

initdb: could not change permissions of directory on Postgresql container

∥☆過路亽.° 提交于 2019-12-07 17:31:58
问题 I am new to the docker ecosystem and I am trying to spin up a simple postgres container along with a volume so it persists its data, by using a yaml composer file. The file is as follows: # Use postgres/example user/password credentials version: '3.3' services: db: image: postgres environment: POSTGRES_DB: recrow POSTGRES_USER: recrow POSTGRES_PASSWORD: recrow_db_1000 PGDATA: /var/lib/pgsql/data/pgdata volumes: - ./pgsql/data:/var/lib/pgsql/data/pgdata However, upon calling docker-compose -f

Need to convert this relatively simple docker pull and run commands into a docker-compose.yml file?

纵饮孤独 提交于 2019-12-07 16:44:46
问题 I have three commands that I am using to "update","re-run", and then "clean up" my current docker image via our CI tool of choice (Jenkins). I'm not including my "container stop and remove" commands for simplicity's sake. docker pull my.private.registry:443/my-awesome-app docker run -d --env-file ./env.list -i -p 8080:8080 -p 9990:9990 my.private.registry:443/my-awesome-app docker rmi $(docker images -f "dangling=true" -q) I'm new to docker-compose and I understand that most of these pull/run

IBM Bluemix erroring when creating volumes via docker-compose up

依然范特西╮ 提交于 2019-12-07 14:43:57
问题 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

Docker(四)----Docker-Compose 详解

时间秒杀一切 提交于 2019-12-07 14:24:57
1. 什么是Docker-Compose Compose项目来源于之前的fig项目,使用python语言编写,与docker/swarm配合度很高。 Compose 是 Docker 容器进行编排的工具,定义和运行多容器的应用,可以一条命令启动多个容器,使用Docker Compose不再需要使用shell脚本来启动容器。 Compose 通过一个配置文件来管理多个Docker容器,在配置文件中,所有的容器通过services来定义,然后使用docker-compose脚本来启动,停止和重启应用,和应用中的服务以及所有依赖服务的容器,非常适合组合使用多个容器进行开发的场景。 docker-compose默认的模板文件是 docker-compose.yml,其中定义的每个服务都必须通过 image 指令指定镜像或 build 指令(需要 Dockerfile)来自动构建。 其它大部分指令都跟 docker run 中的类似。 如果使用 build 指令,在 Dockerfile 中设置的选项(例如:CMD, EXPOSE, VOLUME, ENV 等) 将会自动被获取,无需在 docker-compose.yml 中再次设置。 使用Compose 基本上分为三步: 1.Dockerfile 定义应用的运行环境 2.docker-compose.yml 定义组成应用的各服务 3

docker-compose设置WORKDIR设置工作目录

余生长醉 提交于 2019-12-07 13:54:55
我们知道docker可以设置WORKDIR很方便切换工作目录。 如果采用docker-compose来编排容器怎么切换工作目录呢? docker compose中working_dir是docker run的时候用来设置工作路径的参数 下面图片是docker-compose切换工作目录的例子: 来源: CSDN 作者: fengqiaoguke 链接: https://blog.csdn.net/fengqiaoguke/article/details/99676116

在Ubuntu 14.04上设置私有Docker Registry

北慕城南 提交于 2019-12-07 13:39:29
提供: ZStack云计算 前言 Docker不仅是一个强大的服务器部署工具,而且它还有一个官方的Docker Hub registry用于储存Docker镜像。上传镜像到Docker Hub是免费的,上传的镜像文件同时也对公共领域开放,而这可能不是我们想要的。 本文介绍如何配置一个私有的Docker registry,在此上传的镜像是私密的,你可以从另一个联网的主机以安全的方式下载此registry上的镜像。 本文仅介绍registry的创建,而不讨论应用的容器化。有关Docker镜像创建的操作可参考这篇 Docker入门文章 。 本文在Ubuntu 14.04上实测通过,在其他Debian类系统上应该也可以通过。使用的Docker Registry版本为2.0版。 Docker基本概念 如果你此前尚未用过Docker,那么最好先花几分钟时间了解一下它的基本概念。如果你已经使用过Docker,只想了解建立私有registry部分的内容,则可跳过本小节。 Docker入门者可参阅这篇 Docker Cheat Sheet 。 Docker的核心理念是应用及其依赖项与其运行环境(操作系统)的分离,这种分离通过容器(containers)和镜像(images)来实现。一个Docker镜像本质上来说就是一个文件系统的模板