mviereck / dockerfile-x11docker-deepin

3D desktop deepin from China
MIT License
33 stars 11 forks source link

Some problems relative to docker image creation/updating with x11docker and x11docker-deepin. #12

Closed hongyi-zhao closed 4 years ago

hongyi-zhao commented 4 years ago

Hi,

I've some further questions relative to docker image creation/updating with x11docker and x11docker-deepin as described below:

Regards, HY

mviereck commented 4 years ago

I noticed that the bestwu/docker-deepin, the base of x11docker-deepin, is created based on Deiban.

That is not entirely correct. The Dockerfile uses a FROM debian first, but uses it mainly to run debootstrap on a deepin repository. Than there is a second FROM: FROM scratch. There the files downloaded by debootstrap are used and the previous debian base is dropped.

But I want to create a pure/complete deepin based docker image from scratch. For this purpose, what should be the content of the Dockerfile?

You could combine some ideas of bestwu/deepin with x11docker/deepin. As a start you could replace FROM bestwu/deepin in x11docker/deepin with the Dockerfile content of bestwu/deepin.

You have told me that the x11docker disabled the capability for revision of the runtime base image. But I want to have this feature occasionally. Could you please add an option to x11docker for this function?

I don't understand "runtime base image". Do you mean the container that was created from the image? Normally x11docker removes the container afterwards. There is an undocumented option --keepcache that I use sometimes for debugging. It preserves the cache files and the container.

If I installed some packages in the runtime image container started via x11docker, can I clone/export the new docker image instance with the new installed packages reserved?

I discourage this way because it generates unreproducible images. I recommend to adjust the Dockerfile instead. (Option --sudouser is useful to try out intended changes first.). However, it is possible to create a new image from a container with docker commit -t newimagename containername. Compare https://github.com/mviereck/x11docker/issues/288 Better ways to store user data are options --home and --share.

hongyi-zhao commented 4 years ago

I don't understand "runtime base image". Do you mean the container that was created from the image?

Yep.

Normally x11docker removes the container afterwards. There is an undocumented option --keepcache that I use sometimes for debugging. It preserves the cache files and the container.

I can't find this option:

werner@X10DAi-01:~$ x11docker -h |grep -e --keepcache
werner@X10DAi-01:~$ 
hongyi-zhao commented 4 years ago

However, it is possible to create a new image from a container with docker commit -t newimagename containername. Compare mviereck/x11docker#288

I checked the commit subcommand, and find that it hasn't -t option at all.

werner@X10DAi-01:~$ docker -v
Docker version 19.03.12, build 48a66213fe
werner@X10DAi-01:~$ docker commit --help

Usage:  docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

Create a new image from a container's changes

Options:
  -a, --author string    Author (e.g., "John Hannibal Smith
                         <hannibal@a-team.com>")
  -c, --change list      Apply Dockerfile instruction to the created image
  -m, --message string   Commit message
  -p, --pause            Pause container during commit (default true)
mviereck commented 4 years ago

I can't find this option:

As I said, it is an undocumented option.

I checked the commit subcommand, and find that it hasn't -t option at all.

Ok, than I remembered wrong. Than the command would look like

docker commit containerid newimagename