elkarbackup / elkarbackup

Open source backup solution for your network
https://www.elkarbackup.org
Other
397 stars 67 forks source link

Docker build error (rsnapshot missing in Bullseye) #598

Open xezpeleta opened 3 years ago

xezpeleta commented 3 years ago

Official PHP docker images have been upgraded to Debian Bullseye.

As Rsnapshot is not available in Debian Bullseye, the apt-get install rsnapshot command from the Dockerfile will fail with the current php:7.3-apache base layer.

A quick solution could be to use the php:7.3-apache-buster image instead.

But if we want to move to Bullseye, we should download and install Rsnapshot debian package:

Download URL: http://ftp.de.debian.org/debian/pool/main/r/rsnapshot/rsnapshot_1.4.2-1_all.deb
SHA256 checksum: d49470c4700aba2b00187d6ff68781f869856ff1ef9aa98dcd73b672ffffa866
antton commented 3 years ago

Hi Xabi,

Why don't you try to ADD the .deb file and make the dpkg installation in the dockerfile?

ADD http://foo.com/package.tar.bz2 /tmp/ RUN tar -xjf /tmp/package.tar.bz2 \ && make -C /tmp/package \ && rm /tmp/package.tar.bz2

This is just an example with a tar.bz2.

Let me know!

El lun, 6 sept 2021 a las 22:44, Xabi @.***>) escribió:

Official PHP docker images have been upgraded to Debian Bullseye.

As Rsnapshot is not available in Debian Bullseye, the apt-get install rsnapshot command from the Dockerfile will fail with the current php:7.3-apache base layer.

A quick solution could be to use the php:7.3-apache-buster image instead.

But if we want to move to Bullseye, we should download and install Rsnapshot debian package:

Download URL: http://ftp.de.debian.org/debian/pool/main/r/rsnapshot/rsnapshot_1.4.3-2_all.deb SHA256 http://ftp.de.debian.org/debian/pool/main/r/rsnapshot/rsnapshot_1.4.3-2_all.debSHA256 checksum: 846ac933b4e3a62d67c390e4ef7c5dbfb8e8ae3e1dd267fbf842365b99e0d002

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/elkarbackup/elkarbackup/issues/598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMW35AATYYTC6TI57RMOU3UAUR3BANCNFSM5DRBSKPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

elacunza commented 3 years ago

I guess rsnapshot package in Debian archive will disappear some day (when Buster security support is ended I guess...). I think this will be in about 4 years, for now it seems enough :)

xezpeleta commented 3 years ago

Hi @antton !!

By the moment I fixed the issue using the php buster image, as this was the base layer we were using in our production image until now.

Why don't you try to ADD the .deb file and make the dpkg installation in the dockerfile?

do you mean using the ADD statement instead of downloading and installing rsnapshot with a signle RUN command?

I don't know if it's a good idea. I've read the following from the "Best practices for writing Dockerfiles":

Because image size matters, using ADD to fetch packages from remote URLs is strongly discouraged; you should use curl or wget instead. That way you can delete the files you no longer need after they’ve been extracted and you don’t have to add another layer in your image. For example, you should avoid doing things like:

ADD https://example.com/big.tar.xz /usr/src/things/ RUN tar -xJf /usr/src/things/big.tar.xz -C /usr/src/things RUN make -C /usr/src/things all

https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy

Thanks!!