在 Jenkinsx 构建容器中工作......我正在尝试在 docker 容器中安装卷。目录 get 已挂载,但是,源(主机)目录中存在的文件不存在于容器中。
在这种情况下,主机也是一个 docker 容器,所以基本上我是从 docker 容器运行 docker-compose。
有没有人遇到过这个问题并有解决方案?
以下是结果:
bash-4.2# pwd
/home/jenkins
bash-4.2# ls -l datadir/
total 4
-rw-r--r-- 1 root root 4 May 15 20:06 foo.txt
bash-4.2# cat docker-compose.yml
version: '2.3'
services:
testing-wiremock:
image: rodolpheche/wiremock
volumes:
- ./datadir:/home/wiremock
bash-4.2# df -h
Filesystem Size Used Avail Use% Mounted on
overlay 95G 24G 71G 25% /
tmpfs 7.4G 0 7.4G 0% /dev
tmpfs 7.4G 0 7.4G 0% /sys/fs/cgroup
/dev/sda1 95G 24G 71G 25% /etc/hosts
tmpfs 7.4G 4.0K 7.4G 1% /root/.m2
shm 64M 0 64M 0% /dev/shm
tmpfs 7.4G 4.0K 7.4G 1% /home/jenkins/.docker
tmpfs 7.4G 1.9M 7.4G 1% /run/docker.sock
tmpfs 7.4G 0 7.4G 0% /home/jenkins/.gnupg
tmpfs 7.4G 12K 7.4G 1% /run/secrets/kubernetes.io/serviceaccount
bash-4.2# docker-compose up -d
Creating network "jenkins_default" with the default driver
Creating jenkins_testing-wiremock_1 ... done
bash-4.2# docker ps |grep wiremock
6293dee408aa rodolpheche/wiremock "/docker-entrypoint.…" 26 seconds ago Up 25 seconds 8080/tcp, 8443/tcp jenkins_testing-wiremock_1
8db3b729c5d2 rodolpheche/wiremock "/docker-entrypoint.…" 21 minutes ago Up 21 minutes (unhealthy) 8080/tcp, 8443/tcp zendeskintegration_rest_1
bd52fb96036d rodolpheche/wiremock "/docker-entrypoint.…" 21 minutes ago Up 21 minutes (unhealthy) 8080/tcp, 8443/tcp zendeskintegration_zendesk_1
bash-4.2# docker exec -it 6293dee408aa bash
root@6293dee408aa:/home/wiremock# ls -ltr
total 8
drwxr-xr-x 2 root root 4096 May 15 20:06 mappings
drwxr-xr-x 2 root root 4096 May 15 20:06 __files