Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 343
SangminKim Avatar asked Apr 28 '18 08:04

SangminKim


2 Answers

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
like image 143
Maciej Polańczyk Avatar answered Nov 19 '22 23:11

Maciej Polańczyk


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
like image 43
Pedro Brost Avatar answered Nov 19 '22 23:11

Pedro Brost