docker-compose

fix git diff-files listing all files in docker

↘锁芯ラ 提交于 2019-12-07 12:30:08
问题 I am trying to write a script that will use git to get the files that have changed and run commands based on that. I do my development with docker-compose and here is the repo I am working on https://github.com/my-grocery-price-book/www when running git diff-files from inside the container it lists all the files. when running git diff-files from outside the container list no files. upgrading git inside the container to the latest version of 2.16 still gives the same output. Steps to reproduce

Docker compose ignores my Dockerfile when I use the build command

自古美人都是妖i 提交于 2019-12-07 11:56:45
问题 I have this folder structure: /home/me/composetest /home/me/composetest/mywildflyimage Inside composites I have this docker-compose.yml: web: image: test/mywildfly container_name: wildfly ports: - "8080:8080" - "9990:9990" Inside mywildflyimage I have this docker image: FROM jboss/wildfly EXPOSE 8080 9990 ADD standalone.xml /opt/jboss/wildfly/standalone/configuration/ RUN /opt/jboss/wildfly/bin/add-user.sh admin admin --silent CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "

Windows/Mac下的Docker,如何把Windows的目录映射到容器里,有个小坑

匆匆过客 提交于 2019-12-07 09:26:29
Windows/Mac OS X下的docker是运行在一个Linux虚拟机的, 在这个虚拟机里,运行多个容器。三层啊,真不爽,什么事儿都是隔山跨水的,现在事儿就来了,容器里会报错说找不到被映射过来的文件。 拿Windows举例,有个目录叫做 C:¥WinTestDir ,放了几个文件,现在运行一个容器例如busybox,试图把这个目录映射到容器里的 /xxx/yyy目录下,无论以C:¥WinTestDir还是 /c/WindowsDir 还是 /WindowsDir 都没有效果。 docker run -it -v C:¥WinTestDir:/xxx/yyy busybox 结果会提示说"和:非法字符。 docker run -it -v /WinTestDir:/xxx/yyy busybox docker run -it -v /c/WinTestDir:/xxx/yyy busybox 结果容器里的/xxx/yyy目录下是空的。 这时一般都会意识到,这个冒号左边的目录实际上得是那个虚拟机里存在的目录才行,那么哪些目录被映射到虚拟机里了呢?Docker的文档里写了, Windows系统: C:¥Users -> /c/Users Mac OS X系统: /Users -> /Users 其它的目录压根没被映射进去,跟别提之后往容器里映射了。 docker-machine

docke 和docker-compose常用命令

醉酒当歌 提交于 2019-12-07 08:43:51
常用命令 docker container ls 列出所有正在运行的容器 docker exec -id docker_id bash 命令行方式进入docker docker-compose ps 列出当前docker-compose的镜像文件 1,普通dockers 编译命令 docker build . 当前文件编译,依赖Docker_file sudo docker build . -t containerName_version 编译的时候 containerName_version为tag 启动命令 sudo docker run --net=host -t -i 直接 启动的时候 --net=host 为指定与宿主机共享网卡 后台运行 -d 直接进入container的bash -i -t docker run --net=host --name nebula_sniffer -d n ebula_sniffer:20181129 --name 说明容器名字 -d 后台运行 最后是指定容器,也可以用容器的ID --rm 启动完即可删除 docker-compose docker-compose exec containerName bash docker导出 1,将当前容器保存成新的一个镜像 docker commit nebula containerName

Centos7.x64最新版 安装Docker及docker-compose

女生的网名这么多〃 提交于 2019-12-07 08:39:03
1 环境安装必须是系统支持 通过uname命令来检查内核版本信息 uname -r 2 更新系统包到最新 yum -y update 3. 先删除之前安装的老版本docker(如果有的话) $ sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine 4. 使用repository安装docker ce sudo yum install -y yum-utils device-mapper-persistent-data lvm2 设置源 :官方给出的源 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo ## 官方给出的源,国内比较慢,可以用阿里源替代 如下: sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos

centos7中Fabric基本环境部署

主宰稳场 提交于 2019-12-07 08:32:55
centos7中Fabric基本环境部署 1、环境整理 1.1更新本地依赖 2、Docker安装 2.1、卸载旧版本 2.2、在线安装Docker CE 2.3、Docker启动及常见命令 3、Docker-Compose安装 3.1、在线安装Docker-Compose 4、Go语言环境安装 4.1、配置Go语言环境变量 小结 1、环境整理 Fabric的节点通过Docker容器来运行,启动Fabric网络中的节点需要先安装 Docker 、 Docker-Compose 和 Go 语言环境,然后拉取相关Docker镜像,在通过 配置Compose文件 来启动各个节点。 其中LInux内核在4.X以上,并更新本地依赖,以满足Docker运行。 1.1更新本地依赖 备份本地YUM源: sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 设置阿里YUM源: sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 清理缓存并生成新的缓存: sudo yum clean all sudo yum makecache 更新YUM库(此步骤时间较长):

What are the docker-compose settings that should be removed for production?

前提是你 提交于 2019-12-07 08:30:31
问题 I am trying to create a separate docker-compose for production, currently I only have one compose file which I use for local development, but to make one for production, I don't know what attributes to remove aside volumes and ports my current dev compose file looks like this: version: '3' services: db: container_name: mariadb build: context: ./mariadb volumes: - ./mariadb/scripts:/docker-entrypoint-initdb.d - ./.data/db:/var/lib/mysql - ./logs/mariadb:/var/log/mysql environment: MYSQL_ROOT

Communicating between different docker services in docker-compose

跟風遠走 提交于 2019-12-07 08:21:52
问题 I just started working with docker-compose and am currently struggling with communication between the different services. I have 2 services, alice and bob . I want these to be able to send http requests to each other. As far as I understood, services should be able to reach each other by using the servicename as hostname. Unfortunately, alice in my example is not able to reach bob on http://bob:5557, and bob is not able to reach alice on http://alice:5556. What am I not understanding

Docker compose how to initialize SQL Server DB on Windows container?

走远了吗. 提交于 2019-12-07 08:18:40
问题 I run docker for Windows 18.03 on Windows 10 . I use the microsoft/mssql-server-windows-express (from Windows Server) image from a docker compose file in my own VS 2017 project. What I try to accomplish here is to initialize the database from a script. I tried using the "command" switch in the docker.compose.yml but without much success... Here's the docker compose file : myscustomservice: image: myscustomservice build: context: .\myscustomservice dockerfile: Dockerfile db: image: microsoft

Executable file not found in $PATH

为君一笑 提交于 2019-12-07 07:01:21
问题 I am working in a Dockerfile for PHP-FPM 7.1. I am ending the Dockerfile with the following line: CMD ["php71-php-fpm"] Because I am using docker-compose this is how I start up the container: docker-compose up -d The container compiles fine (apparently) as per this lines: Successfully built 014e24455b53 WARNING: Image for service php was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`. Creating php71-fpm But it