mviereck / dockerfile-x11docker-deepin

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

The cleanup script will destroy the cache used by synaptic. #36

Closed hongyi-zhao closed 3 years ago

hongyi-zhao commented 3 years ago

If I use the cleanup script after the apt-get update command in the last layer, I find it will destroy the cache used by synaptic, which will prohibit synaptic from start in the container. See the following screenshot for more info:

image

So I think that the operations done by the cleanup script are too aggressive.

mviereck commented 3 years ago

So I think that the operations done by the cleanup script are too aggressive.

Yes, that might be right. But it still saves a lot of disk space. The issue can easily be fixed with apt-get update before running synaptic. I think that is reasonable.

Another question: How did you start synaptic in container? I found that I cannot run GUI applications in container with sudo anymore. It only works if I run with --user=root.

hongyi-zhao commented 3 years ago

How did you start synaptic in container?

I run it as normal user just to inspect/find packages more convenient temporarily.

I found that I cannot run GUI applications in container with sudo anymore.

I also have this problem. BTW, I can run the following command on host and still can't figure out the reason:

$ sudo synaptic

It only works if I run with --user=root.

What's the full command line?

mviereck commented 3 years ago

What's the full command line?

Just add --user=root to the x11docker command.

I run it as normal user just to inspect/find packages more convenient temporarily.

Ok, as normal user it works here, too.

mviereck commented 3 years ago

I found that I can run sudo synaptic if I add either --xoverip or--hostnet.

hongyi-zhao commented 3 years ago

I found that I can run sudo synaptic if I add either --xoverip or --hostnet.

Confirmed the same behavior for my case. If so, the --xoverip maybe a more preferable way for this job than --hostnet.

mviereck commented 3 years ago

I've opened a ticket about failing GUI applications with sudo: https://github.com/mviereck/x11docker/issues/307

So I think that the operations done by the cleanup script are too aggressive.

Yes, that might be right. But it still saves a lot of disk space. The issue can easily be fixed with apt-get update before running synaptic. I think that is reasonable.

It might be a reasonable fix to put this at the end of the Dockerfile:

RUN apt-get update && \
    find /var/lib/apt/lists -type f -delete

This keeps the files in /var/cache/apt and should allow synaptic to start.

hongyi-zhao commented 3 years ago

It might be a reasonable fix to put this at the end of the Dockerfile:

RUN apt-get update && \
    find /var/lib/apt/lists -type f -delete

This keeps the files in /var/cache/apt and should allow synaptic to start.

Maybe you can rewrite the cleanup script with an option which determines the types of the cleaning operations corresponding to different requirements.

mviereck commented 3 years ago

Maybe you can rewrite the cleanup script with an option which determines the types of the cleaning operations corresponding to different requirements.

That goes too far. /cleanup is just a small simple helper for this Dockerfile. My proposal would fix that minor synaptic issue if considered to be important.

hongyi-zhao commented 3 years ago

To be frank, I just deleted the last cleanup command in the Dockerfile.