Mounted volumes are not populated with docker image content

I am running Container Linux by CoreOS 1618.0.0 (Ladybug) .

with rkt Version: 1.29.0

I created a systemd service file to run the docker nagios image:

 [Unit] Description=Nagios Requires=network-online.target local-fs.target After=network-online.target local-fs.target [Install] WantedBy=multi-user.target [Service] Slice=machine.slice ExecStart=/usr/bin/rkt run --port=80-tcp:8018 --insecure-options=image --volume volume-var-log-apache2,kind=host,source=/mnt/storage/nagios/apache2-log --volume volume-usr-share-snmp-mibs,kind=host,source=/mnt/storage/nagios/snmp-mibs --volume volume-opt-nagiosgraph-etc,kind=host,source=/mnt/storage/nagios/nagiosgraph/etc --volume volume-opt-nagiosgraph-var,kind=host,source=/mnt/storage/nagios/nagiosgraph/var --volume volume-opt-nagios-libexec,kind=host,source=/mnt/storage/nagios/nagios/libexec --volume volume-opt-nagios-var,kind=host,source=/mnt/storage/nagios/etc,readOnly=false --volume volume-opt-nagios-etc,kind=host,source=/mnt/storage/nagios/var,readOnly=false --volume volume-opt-custom-nagios-plugins,kind=host,source=/mnt/storage/nagios/custom-plugins docker://jasonrivers/nagios:latest KillMode=mixed Restart=always RestartSec=0 ExecStopPost=/usr/bin/rkt gc --mark-only 

now the problem is that the established bindings are not populated with the corresponding image files.

usually what i do is extract the image itself and manually copy the corresponding files.

question ... is there another?

I hope that I skipped the rkt parameter, which fills the corresponding mounted directories with files in the docker image in the specified places

any ideas?

+5
source share
1 answer

You should not expect the volume to be automatically filled with any files in the image at that particular mount point. Actually the opposite happens, (apparently empty) the volume hides what is in the image. See this: https://github.com/appc/spec/blob/master/spec/ace.md#volume-setup

So, if you want to pre-populate volumes with files from the image, I believe that you are doing the right thing by manually extracting the image.

+2
source

Source: https://habr.com/ru/post/1273985/


All Articles