Hi all:
I tried to run one of my pipelines today and get the message
+ apt-get update
bash: apt-get: command not found
it uses the following image:
image: bitnami/git
The pipeline is run via https://bitbucket.org/myaccountname/myrepo/pipelines
When I ran it end of September all was still working. Any suggestions?
Thanks,
Gunter
The Bitnami Git container does not contain apt-get or any package manager, which is purposefully done for security, performance, and size reasons. This is typical for Bitnami "distroless" or minimal images, as indicated by the "apt-get: command not found" error in your Bitbucket pipeline using the image bitnami/git.
The Reason This Worked Earlier
Bitnami updates container base images on a regular basis. While earlier versions may have used a different base image or incorporated apt, most recent versions do not.
If you rely on apt-get instructions, the error just appears now since the package management was probably removed in the most recent bitnami/git image upgrade.
Try this once:
Change the Image: Use an Ubuntu or Debian-based image with a package management installed (for instance, ubuntu:latest, debian:latest, or even node:16 if you also need node). This enables the apt-get update to function as planned.
Create your own Dockerfile by starting with a base (such as Debian/Ubuntu), installing git, and adding any other components you require. Then, use the image in your pipeline.
Pre-build Dependencies: Use Bitbucket's built-in support or another "fatter" container where necessary packages are already installed if you only need git for cloning or checkout.
I hope this helps!
Thanks for pointing this out and the explanation. That helped me understand pipelines a bit more. Since I am only using git ftp, I changed the image to "wagnerstephan/bitbucket-git-ftp:latest". This allowed me to remove "apt-get" completely.
Gunter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much! Happy to help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.