When you create, you have the option to copy files from the host to the image you create (with COPY
or directive ADD
)
You can also copy files from the container (the image that was docker run
' d) to the host with docker cp (usually, cp can also copy from the host to the container)
" Docker": Docker - , , .
, (, script ssl), , cp.
. , getcrt script.
docker run -u root --entrypoint=/bin/sh --rm -i -v ${HOME}/b2d/apache:/apache apache << COMMANDS
pwd
cp crt /apache
cp key /apache
echo Changing owner from \$(id -u):\$(id -g) to $(id -u):$(id -u)
chown -R $(id -u):$(id -u) /apache/crt
chown -R $(id -u):$(id -u) /apache/key
COMMANDS
COMMANDS
- , , cp
, ${HOME}/b2d/apache
, /apache
-v ${HOME}/b2d/apache:/apache
.
, , - /apache
, ${HOME}/b2d/apache
!