alohisius
alohisius

Reputation: 41

Unable to push docker image on local private registry

I'am struggling with this problem. I have to push a docker image (which work rigthly with docker-compose up) to my local registry which was setup with the following command:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

This is the output of 'docker ps'

5fe319f37d5c registry:latest "/entrypoint.sh /etc/" 41 hours ago Up About an hour 0.0.0.0:5000->5000/tcp registry

I follow the steps to push the image:

docker-compose up --build docker tag gatewayapi_api localhost:5000/gatewayapi_api docker push localhost:5000/gatewayapi_api

but in every case I obtain

file integrity checksum failed for "etc/default/cacerts

I try every solution (restart docker, clean image, restart registry)

Thanks in advance.

Upvotes: 4

Views: 3887

Answers (3)

Luc
Luc

Reputation: 1

Faced the same problem in Ubuntu 20.04 with package docker.io. Would have error "file integrity checksum failed" when pushing image to my private docker registry. In my case the problem was fixed by following this official fix from Docker web site:

https://docs.docker.com/engine/install/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities

Note that my Docker private registry was running as a container as above:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

I was building and pushing Docker images from the same Docker engine on the same Ubuntu 20.04 computer, communicating through the socket (not the ethernet).

I don't know if the problem was from the Docker client building the image or from the Docker private registry receiving the image, which was itself running as a container. In any case, following the above official fix was the only thing I needed to get the problem resolved, I changed nothing else.

  1. Log into the Ubuntu or Debian host as a user with sudo privileges.

  2. Edit the /etc/default/grub file. Add or edit the GRUB_CMDLINE_LINUX line to add the following two key-value pairs:

GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

  1. Update GRUB. If your GRUB configuration file has incorrect syntax, an error occurs. In this case, repeat steps 2 and 3.

$ sudo update-grub

  1. The changes take effect when the system is rebooted.

Upvotes: 0

Vasyl Boroviak
Vasyl Boroviak

Reputation: 6128

In this GitHub issue people are sharing their findings how to fix that issue.

TL;DR:

  • On docker for Mac you might need to increase docker VM memory in the app Preferences->Advanced->Memory
  • If did not help then cleanup might do it (helped me): docker system prune -a

Upvotes: 7

Elton Stoneman
Elton Stoneman

Reputation: 19144

Does your registry work correctly with an official image? Like this:

docker pull alpine
docker tag alpine localhost:5000/my-alpine
docker push localhost:5000/my-alpine

Upvotes: 1

Related Questions