Fairly new to using Docker..
I pulled an image for Oracle 11g Full. Created a DB and installed an application into the container.
Once configured correctly, I committed the container which resulted in a 15GB image.
Tested a new container of that image, everything works fine, Oracle services etc. startup automatically and then I just attach and run the application...all good.
I need to upload this onto a server, so my intended approach was:
1) Save container
2) Upload tarball to server
3) Load container
However, when I run the following command:
sudo docker save --output ~/etlf_961_meta.tar etlf/informatica9.6.1:latest
it just hangs and produces no output.
The process is active, but no file appears and there is no activity:
T20 chris # ps aux | grep "docker save"
root 26179 0.0 0.0 91928 5000 pts/14 S+ 16:36 0:00 sudo docker save --output /home/chris/etlf_961_meta.tar etlf/informatica9.6.1:latest
root 26201 0.0 0.0 127404 14664 pts/14 Sl+ 16:36 0:00 docker save --output /home/chris/etlf_961_meta.tar etlf/informatica9.6.1:latest
root 26277 0.0 0.0 14232 980 pts/0 S+ 16:36 0:00 grep --color=auto docker save
If I use export
and import
the process runs fine, a 15GB image is produced and can be imported, however I lose all the ENV and CMD metadata.
Can anyone advise:
1) How to resolve the save
command, to actually export the container
or
2) How to restore or attach the ENV/CMD metadata (..the dockerfile?) to a exported/imported image?
Much appreciated
Since you are new to docker I'd like to suggest some things that might make your life easier:
I committed the container which resulted in a 15GB image.
commit
is generally not recommended for standard workflows. It is not really reproducible. I would suggest creating a Dockerfile
using FROM <oracle image>
and doing the work in the Dockerfile
.
If you have large datasets you probably want to manage those in volumes or a host bind mount (aka volume mount).
I need to upload this onto a server,
The recommended way of doing this is using docker push
to push to a registry.
it just hangs and produces no output.
It could be that it's just very slow? You can also check the docker daemon log file to see if there are any warnings.
How to restore or attach the ENV/CMD metadata (..the dockerfile?) to a exported/imported image?
I don't think this is possible.
https://github.com/docker/for-mac/issues/2308
Version 17.12.0-ce-mac46 (21698) solved this problem, image saved successfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With