cruizba / ubuntu-dind

A docker image based in ubuntu to run docker containers inside docker containers
Apache License 2.0
169 stars 76 forks source link

apt install fails when using ubuntu-dind as base image #20

Closed aphex3k closed 10 months ago

aphex3k commented 10 months ago
FROM cruizba/ubuntu-dind

RUN apt update && apt install -y bash curl sudo

produces the following error when building:

0.037                                                                                                                                                 
0.037 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
0.037 
1.342 Hit:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
1.397 Err:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
1.397   At least one invalid signature was encountered.
1.472 Get:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [119 kB]
2.018 Err:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
2.018   At least one invalid signature was encountered.
2.096 Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease [109 kB]
2.250 Err:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
2.250   At least one invalid signature was encountered.
2.339 Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [110 kB]
2.476 Err:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
2.476   At least one invalid signature was encountered.
2.478 Fetched 338 kB in 2s (140 kB/s)
2.478 Reading package lists...
2.843 Building dependency tree...
2.915 Reading state information...
2.922 2 packages can be upgraded. Run 'apt list --upgradable' to see them.
2.922 W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ports.ubuntu.com/ubuntu-ports jammy InRelease: At least one invalid signature was encountered.
2.922 W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease: At least one invalid signature was encountered.
2.922 W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease: At least one invalid signature was encountered.
2.922 W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease: At least one invalid signature was encountered.
2.922 W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy/InRelease  At least one invalid signature was encountered.
2.922 W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease  At least one invalid signature was encountered.
2.922 W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-backports/InRelease  At least one invalid signature was encountered.
2.922 W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/jammy-security/InRelease  At least one invalid signature was encountered.
2.922 W: Some index files failed to download. They have been ignored, or old ones used instead.
2.925 
2.925 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
2.925 
2.942 Reading package lists...
3.268 Building dependency tree...
3.342 Reading state information...
3.420 bash is already the newest version (5.1-6ubuntu1).
3.420 curl is already the newest version (7.81.0-1ubuntu1.13).
3.420 The following NEW packages will be installed:
3.420   sudo
3.425 E: You don't have enough free space in /var/cache/apt/archives/.
3.425 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
3.425 Need to get 807 kB of archives.
3.425 After this operation, 2392 kB of additional disk space will be used.
------
failed to solve: process "/bin/sh -c apt update     && apt install -y bash curl sudo" did not complete successfully: exit code: 100
cruizba commented 10 months ago

Hello @aphex3k,

I've tested your use case, and it is working for me.

I think your disk is full:

3.425 E: You don't have enough free space in /var/cache/apt/archives/.

Take into account that, due to the nature of Docker in Docker, when a container is created, it creates a volume in the system. So, you may have some orphaned volumes around your system.

If Docker volumes are the problem, just clean everything (make sure not to delete any important image/volume you may have in your system):

docker system prune -a --volumes

What I do is either prune the volumes from time to time or run the Docker image while persisting the state of the Docker inside the container:

-v "$(pwd)"/var-lib-docker:/var/lib/docker

In this way, I don't have to pull the images all the time when I run a DinD container.

Please let me know if this was your problem :)

aphex3k commented 10 months ago

Yep, my disk storage was full indeed... sorry