docker-compose

How to store a specific named docker volume at a specific location without changing the default?

一笑奈何 提交于 2019-12-07 03:36:01
问题 I would like to create a named volume for one of my containers. This container will need a lot more storage than other containers I run, so I would like to store that particular volume on a different disk that has lots of free space. I still want the other volumes on the default disk, only that one named volume should go on another disk. I don't want to use a bind mount because it will make backing up and migrating more complicated. The only option I can think of is to manually move the

Getting Docker for mac proxy variables through terminal

二次信任 提交于 2019-12-07 02:50:16
问题 I am using Docker for mac behind a proxy. I set up the proxy configuration in the Docker GUI under "Proxies" -> "Manual proxy configuration". This lets me download Docker images from the repository behind the proxy. Next, I set the http_proxy and https_proxy environment variables and I use them in my docker-compose.yml to pass them to the build: services: app: build: context: . args: http_proxy: $http_proxy https_proxy: $https_proxy How can I get the variables that I set through the Docker

php docker link apache docker

ε祈祈猫儿з 提交于 2019-12-07 01:44:58
问题 I build 2 dockers, one docker with apache, one docker with php5, and I use docker-compose to start. apache2 Dockerfile in directoy apache2: FROM debian:latest RUN apt-get update && apt-get install -y apache2 ADD test.php /var/www/html CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] and test.php: <?php phpinfo(); ?> php5 Dorckerfile in directory php: FROM debian:latest RUN apt-get update && apt-get install -y php5 docker-compose.yml: apache: build: ./apache2 container_name: apache ports: -

Docker学习笔记(二):使用docker-compose管理docker环境

爷,独闯天下 提交于 2019-12-07 01:41:36
在上一章中已经完成了搭建和连接nginx-php-fpm和mysql容器的工作。每次我们需要启动工作环境的时候,需要运行以下命令(需要先运行被连接的容器): #docker start my-mysql #docker start my-lnmp 我们尽量把环境软件分开封装到不同的容器,便于当作插件以后再别的地方复用。这就导致可能运行PHP环境需要分别运行nginx容器,php容器,mysql容器,以后可能扩展为更多的容器,每次重启时都需要一个一个开启所有的容器,还要注意先后顺序,这样的操作就很繁琐了。docker-compose可以帮我们解决这个问题,docker-compose是一个用来帮用户定义与运行多个容器的docker应用程序。与composer类似,docker-compose的工作可以理解为:在项目入口编写配置文件,运行时根据配置文件加载运行环境需要的所有镜像(类似于composer中需要依赖的库),如果本地存在的镜像直接创建容器并使用它运行该容器,如果本地镜像不存在则从dockers hub上下载镜像再创建容器。同时每个镜像又可以通过dockerfile文件修改,如安装软件等。这样,我们在每次重启服务器之后就不需要再依次运行容器而是直接进入docker-compose的配置文件目录,一行命令即可运行所有配置中的容器。 首先安装docker-compose. curl

我的docker随笔17:使用docker-compose启动MySQL、Redis和Mongo

主宰稳场 提交于 2019-12-07 01:39:49
一、背景 有网友咨询用docker-compose启动几个存储服务,这些服务包括了MySQL、Redis、Mongo。恰好笔记没做过这一方面,趁机会学习一下。 二、要求 需要启动的docker如下: docker run -d --name myredis -v $PWD/data:/data -p 6378:6379 redis --appendonly yes docker run --name=mysql -d -p 3306:3306 -e TZ=Asia/Shanghai \ --mount type=bind,source="$(PWD)"/data,target=/var/lib/mysql mysql/mysql-server:5.6 \ --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci \ --explicit_defaults_for_timestamp=false docker run -d --name mongo -p 27017:27017 mongo 分析如下: 除了常用的docker启动操作外,Redis需要添加持久化的配置,MySQL复杂很多,有时区,有挂载目录,有字符集编码配置。 三、实验 3.1 配置文件 先给出docker-compose文件,如下:

解决: -bash: docker-compose: command not found、linux 安装 docker-compose

北慕城南 提交于 2019-12-07 01:38:08
1. 运行docker-compose 命令报错: -bash: docker-compose: command not found 2.安装: 1)先安装 pip ,检查是否已有: pip -V 报错: -bash: pip: command not found 安装 pip : yum -y install epel-release yum -y install python-pip #升级 pip install --upgrade pip 2) 安装Docker-Compose: pip install docker-compose 检查是是否成功: docker-compose -version OK 了。 参考: https://www.cnblogs.com/YatHo/p/7815400.html 来源: CSDN 作者: 微风--轻许-- 链接: https://blog.csdn.net/u011314442/article/details/84570872

Docker compose reusing volumes

喜欢而已 提交于 2019-12-07 01:07:38
问题 I'm trying to create a new Docker image that no longer uses volumes from a running container that does use images. The volumes were created using docker-compose file, not Dockerfile. The problem is, when I launch a new container via new docker-compose.yml file it still has the volumes mapped. I still need to keep these volumes and the original containers/images that use them. Also, if possible I would like to continue to use the same docker image, just add a new version, or :latest. Here's

Error invoking chaincode using Node.js SDK [TypeError: Cannot read property 'getConnectivityState' of undefined]

让人想犯罪 __ 提交于 2019-12-07 00:46:27
Failed to invoke successfully :: TypeError: Cannot read property 'getConnectivityState' of undefined /opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355 if(self._stream) state = self. stream.call.channel .getConnectivityState(); ^ TypeError: Cannot read property 'getConnectivityState' of undefined at ClientDuplexStream.<anonymous> (/opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355:56) at emitOne (events.js:116:13) at ClientDuplexStream.emit (events.js:211:7) at ClientDuplexStream._emitStatusIfDone (/opt/share/hyperledger/node_modules/grpc/src/client.js:236

Docker container not starting giving “OCI runtime create failed”

若如初见. 提交于 2019-12-06 22:38:30
问题 I have installed the Docker version 17.12.0-ce, build c97c6d6 When I try to start any container it gives the following error docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/2c910acea8a0cdd4ea6e2dd87616897b4e62b0913ba5014415bd6066eaf36868/ docker info : [root@MDMNext99001 /]# docker info Containers: 1 Running: 0 Paused: 0 Stopped: 1 Images: 1 Server Version: 17.12.0-ce

Jenkins wrong volume permissions

蹲街弑〆低调 提交于 2019-12-06 18:52:31
问题 I have a virtual machine hosting Oracle Linux where I've installed Docker and created containers using a docker-compose file. I placed the jenkins volume under a shared folder but when starting the docker-compose up I got the following error for Jenkins : jenkins | touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied jenkins | Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions? jenkins exited with code 1 Here's the volumes