You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the root of the problem is that I am trying to use a ssh key in a docker container (gocd-server) to be able to pull source code from a private git repository.
Now, if I understand correctly, I need to create a volume where I put my ssh keys and config file but the folder created is not shared between my container and my host. It only works if I copy the key inside my container and pull but if I restart the container, the setup is gone and I need to do it again.
I can see that my container is writing on my host for a few volumes but not for others.
For example, ./gocd/config (host) and /etc/go (container)
*host : *
[20:23:07 - gillouche@arch:~/data/docker/gocd/config]$ ll
total 92K
-rw-r--r-- 1 go go 2.5K Mar 2 06:22 agentkeystore
-rw-r--r-- 1 go go 16 Mar 2 06:22 cipher
-rw-r--r-- 1 go go 992 Mar 2 06:22 config.properties
-rw-r--r-- 1 go go 304 Mar 2 20:08 cruise-config.xml
-rw-r--r-- 1 go go 967 Mar 2 06:22 cruise-config.xml.2016-03-02-05-23-01
-rw-r--r-- 1 go go 45K Mar 2 20:08 cruise-config.xsd
-rw-r--r-- 1 go go 607 Mar 2 06:23 gadget_truststore.jks
-rw-r--r-- 1 go go 799 Mar 2 06:22 go_update_server.pub
-rw-r--r-- 1 go go 3.8K Mar 2 06:22 jetty.xml
-rw-r--r-- 1 go go 1.5K Mar 2 06:22 keystore
-rw-r--r-- 1 go go 1.9K Mar 2 20:08 log4j.properties
-rw-r--r-- 1 go go 2.4K Mar 2 06:22 truststore
(I never wrote any of those files, they were written by the container) container
root@746df548519b:/etc/go# ls -l
total 4
-rw------- 1 go go 1890 Feb 16 16:27 log4j.properties
I am using a docker-compose file and all my docker containers config/folders etc are in the same folder called docker.
Client:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Thu Feb 25 09:29:05 2016
OS/Arch: linux/amd64
Server:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Thu Feb 25 09:29:05 2016
OS/Arch: linux/amd64
Output of **docker info**:
Containers: 13
Running: 4
Paused: 0
Stopped: 9
Images: 28
Server Version: 1.10.2
Storage Driver: devicemapper
Pool Name: docker-8:3-6684765-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 3.148 GB
Data Space Total: 107.4 GB
Data Space Available: 104.2 GB
Metadata Space Used: 5.943 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.142 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.115 (2016-01-25)
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 4.4.1-2-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.61 GiB
Name: arch
ID: BNDD:6TTK:C7YZ:HG7K:FQQT:MQLA:MVQL:2Q57:F6BU:F4BB:ZQVT:PCQS
Provide additional environment details (AWS, VirtualBox, physical, etc.):
No virtualbox, I am trying on my host first before moving everything to a synology NAS.
Describe the results you received:
My container and my hosts don't see the changes on the volume.
Describe the results you expected:
Be able to create file on the host folder and the container can see them.
Provide additional info you think is important:
Thanks.
The text was updated successfully, but these errors were encountered:
Since all the host volume path in your docker compose start with ./ the host directory is mounted instead of a named volume being used.
My docker-compose understanding is still limited unfortunately, so I'll give you a bit more details from a straight docker engine usage.
Any changes you make to the container outside of those bind mounts should stay within the container though, you would only lose them if you were to use --rm as part of your docker run if not, upon a subsequent docker start everything should still be there.
Hello,
the root of the problem is that I am trying to use a ssh key in a docker container (gocd-server) to be able to pull source code from a private git repository.
Now, if I understand correctly, I need to create a volume where I put my ssh keys and config file but the folder created is not shared between my container and my host. It only works if I copy the key inside my container and pull but if I restart the container, the setup is gone and I need to do it again.
I can see that my container is writing on my host for a few volumes but not for others.
For example, ./gocd/config (host) and /etc/go (container)
*host : *
[20:23:07 - gillouche@arch:~/data/docker/gocd/config]$ ll
total 92K
-rw-r--r-- 1 go go 2.5K Mar 2 06:22 agentkeystore
-rw-r--r-- 1 go go 16 Mar 2 06:22 cipher
-rw-r--r-- 1 go go 992 Mar 2 06:22 config.properties
-rw-r--r-- 1 go go 304 Mar 2 20:08 cruise-config.xml
-rw-r--r-- 1 go go 967 Mar 2 06:22 cruise-config.xml.2016-03-02-05-23-01
-rw-r--r-- 1 go go 45K Mar 2 20:08 cruise-config.xsd
-rw-r--r-- 1 go go 607 Mar 2 06:23 gadget_truststore.jks
-rw-r--r-- 1 go go 799 Mar 2 06:22 go_update_server.pub
-rw-r--r-- 1 go go 3.8K Mar 2 06:22 jetty.xml
-rw-r--r-- 1 go go 1.5K Mar 2 06:22 keystore
-rw-r--r-- 1 go go 1.9K Mar 2 20:08 log4j.properties
-rw-r--r-- 1 go go 2.4K Mar 2 06:22 truststore
(I never wrote any of those files, they were written by the container)
container
root@746df548519b:/etc/go# ls -l
total 4
-rw------- 1 go go 1890 Feb 16 16:27 log4j.properties
I am using a docker-compose file and all my docker containers config/folders etc are in the same folder called docker.
Here is my configurations :
Docker compose file
gocd-server:
container_name: gocd-server
image: gocd-server-test
ports:
- "18153:8153"
- "18154:8154"
volumes:
- ./gocd/db:/var/lib/go-server/db/h2db
- ./gocd/plugins:/var/lib/go-server/plugins/external
- ./gocd/flyweight:/var/lib/go-server/pipelines/flyweight
- ./gocd/config:/etc/go
- ./gocd/ssh:/var/go/.ssh
- ./gocd/artifacts:/var/lib/go-server/artifacts
Here is the *_docker inspect *_of the running container
http://pastebin.com/CkXRjfu1
Here is the dockerfile I used to create my gocd image
http://pastebin.com/yLq2CpfN
**Output of
docker version**
:Client:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Thu Feb 25 09:29:05 2016
OS/Arch: linux/amd64
Server:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Thu Feb 25 09:29:05 2016
OS/Arch: linux/amd64
Output of
**docker info**
:Containers: 13
Running: 4
Paused: 0
Stopped: 9
Images: 28
Server Version: 1.10.2
Storage Driver: devicemapper
Pool Name: docker-8:3-6684765-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 3.148 GB
Data Space Total: 107.4 GB
Data Space Available: 104.2 GB
Metadata Space Used: 5.943 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.142 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Either use
--storage-opt dm.thinpooldev
or use--storage-opt dm.no_warn_on_loop_devices=true
to suppress this warning.Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.115 (2016-01-25)
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 4.4.1-2-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.61 GiB
Name: arch
ID: BNDD:6TTK:C7YZ:HG7K:FQQT:MQLA:MVQL:2Q57:F6BU:F4BB:ZQVT:PCQS
Provide additional environment details (AWS, VirtualBox, physical, etc.):
No virtualbox, I am trying on my host first before moving everything to a synology NAS.
Describe the results you received:
My container and my hosts don't see the changes on the volume.
Describe the results you expected:
Be able to create file on the host folder and the container can see them.
Provide additional info you think is important:
Thanks.
The text was updated successfully, but these errors were encountered: