docker-compose

connecting to a docker-compose mysql container denies access but docker running same image does not

被刻印的时光 ゝ 提交于 2019-12-17 15:39:02
问题 I am having some issues connecting to the mysql docker container that I have launched with docker-compose. This is a long post (sorry!). Here is my docker-compose.yml file: db: image: mysql:5.7 ports: - "3306:3306" # I have tried both ports and expose "3306". Still doesn't work environment: - MYSQL_ROOT_PASSWORD="secret" - MYSQL_USER="django" - MYSQL_PASSWORD="secret" - MYSQL_DATABASE="myAppDB" Then: $> docker-compose build db uses an image, skipping #expected! $> docker-compose up <<LOTS OF

docker-compose: difference between network and link

核能气质少年 提交于 2019-12-17 10:52:31
问题 I'm learning docker. I see those two terms make me confuse. For example here is a docker-compose that defined two services redis and web-app . services: redis: container_name: redis image: redis:latest ports: - "6379:6379" networks: - lognet app: container_name: web-app build: context: . dockerfile: Dockerfile ports: - "3000:3000" volumes: - ".:/webapp" links: - redis networks: - lognet networks: lognet: driver: bridge This docker-compose file defines a bridge network named lognet and all

How to set a path on host for a named volume in docker-compose.yml

好久不见. 提交于 2019-12-17 10:21:48
问题 Example below creates dbdata named volume and references it inside db service: version: '2' services: db: image: mysql volumes: - dbdata:/var/lib/mysql volumes: dbdata: driver: local (from https://stackoverflow.com/a/35675553/4291814) I can see the path for the volume defaults to: /var/lib/docker/volumes/<project_name>_dbdata My question is how to configure the path on host for the dbdata volume? 回答1: With the local volume driver comes the ability to use arbitrary mounts; by using a bind

Docker-Compose persistent data MySQL

亡梦爱人 提交于 2019-12-17 10:08:08
问题 I can't seem to get MySQL data to persist if I run $ docker-compose down with the following .yml version: '2' services: # other services data: container_name: flask_data image: mysql:latest volumes: - /var/lib/mysql command: "true" mysql: container_name: flask_mysql restart: always image: mysql:latest environment: MYSQL_ROOT_PASSWORD: 'test_pass' # TODO: Change this MYSQL_USER: 'test' MYSQL_PASS: 'pass' volumes_from: - data ports: - "3306:3306" My understanding is that in my data container

How to get docker-compose to always re-create containers from fresh images?

只谈情不闲聊 提交于 2019-12-17 08:04:19
问题 My docker images are built on a Jenkins CI server and are pushed to our private Docker Registry. My goal is to provision environments with docker-compose which always start the originally built state of the images. I am currently using docker-compose 1.3.2 as well as 1.4.0 on different machines but we also used older versions previously. I always used the docker-compose pull && docker-compose up -d commands to fetch the fresh images from the registry and start them up. I believe my preferred

Docker-compose: node_modules not present in a volume after npm install succeeds

别来无恙 提交于 2019-12-17 03:51:55
问题 I have an app with the following services: web/ - holds and runs a python 3 flask web server on port 5000. Uses sqlite3. worker/ - has an index.js file which is a worker for a queue. the web server interacts with this queue using a json API over port 9730 . The worker uses redis for storage. The worker also stores data locally in the folder worker/images/ Now this question only concerns the worker . worker/Dockerfile FROM node:0.12 WORKDIR /worker COPY package.json /worker/ RUN npm install

Docker-compose: node_modules not present in a volume after npm install succeeds

非 Y 不嫁゛ 提交于 2019-12-17 03:51:51
问题 I have an app with the following services: web/ - holds and runs a python 3 flask web server on port 5000. Uses sqlite3. worker/ - has an index.js file which is a worker for a queue. the web server interacts with this queue using a json API over port 9730 . The worker uses redis for storage. The worker also stores data locally in the folder worker/images/ Now this question only concerns the worker . worker/Dockerfile FROM node:0.12 WORKDIR /worker COPY package.json /worker/ RUN npm install

k8s之安装环境装备四

天大地大妈咪最大 提交于 2019-12-16 15:36:50
Harbor - 企业级 Docker 私有仓库 一、安装底层需求 Python应该是2.7或更高版本 Docker引擎应为1.10或更高版本 Docker Compose需要为1.6.0或更高版本 docker-compose: curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod a+x /usr/local/bin/docker-compose docker-compose version 二、Harbor 安装 Harbor 官方地址:https://github.com/vmware/harbor/releases 1、解压软件包:tar xvf harbor-offline-installer-.tgz https://github.com/vmware/harbor/releases/download/v1.2.0/harbor-offline-installer-v1.2.0.tgz tar -zxvf harbor-offline-installer-v1.2.0.tgz mv harbor /usr/local cd /usr/local

docker-compose

岁酱吖の 提交于 2019-12-16 10:46:44
1、推荐文章: 使用docker-compose 大杀器来部署服务 上 - 割肉机 - 博客园 ,包含部署和简单使用的一体化介绍。 Docker入门之docker-compose - minseo - 博客园 ,包含文件参数和命令详细介绍。 docker-compose.yml的使用 - Ray_chen - 博客园 ,文件参数的简明介绍。 来源: https://www.cnblogs.com/StarkBrothers/p/12040594.html

docker compose 使用

瘦欲@ 提交于 2019-12-15 07:21:07
安装docker-compose yum install -y epel-release yum install -y python-pip pip install -i https://pypi.tuna.tsinghua.edu.cn/simple docker-compose == 1.24.1 # 如果python-pip报错 vim /etc/yum.repos.d/epel.repo 修改配置文件,注释掉metalink ,取消注释 baseurl 操作命令 compose操作容器(一定要进入配置文件目录) 后台启动容器:docker-compose up -d 查看容器运行情况:docker-compose ps 停止并删除容器:docker-compose down 停止并删除容器并删除volume:docker-compose down --volumes 停止启动容器:docker-compose stop;docker-compose start docker-compose exec的使用:docker-compose exec redis bash 总结: 操作docker-compose一定要在配置文件docker-compose.yml文件路径下操作 格式一定要注意,该空格要空格 配置文件 docker-compose.yml version : '3