简体   繁体   中英

How to install docker-compose in jenkinsci/blueocean?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM