The docker
image jenkinsci/blueocean seems official since the official document is mentioning the image.
I want to run docker-compose
command in the container but this image only comes with docker
but not docker-compose
.
Thus, I tried to install docker-compose
as the usual way inside the container.
$ curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
It looked installed successfully, however, when I run docker-compose --version
, it returns bash: ./docker-compose: No such file or directory
, even though I can see the docker-compose
executable at $(which docker-compose)
.
(This error is not relative with $PATH
, I tried to run directly at the directory where docker-compose
is located)
How could I install docker-compose
in the image, that is, how can I build new image containing docker-compose
based on jenkinsci/blueocean
?
For me worked solution from "INSTALL AS A CONTAINER" which is:
$ sudo curl -L --fail https://github.com/docker/compose/releases/download/1.21.2/run.sh -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
You need to add glibc:
FROM jenkinsci/blueocean
USER root
RUN curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose
RUN apk add ca-certificates wget && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
GLIBC_VERSION='2.27-r0' && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk && apk add glibc-${GLIBC_VERSION}.apk && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk && apk add glibc-bin-${GLIBC_VERSION}.apk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With