Get docker compose installed
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -11,12 +11,14 @@ RUN apt-get update && \
|
|||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
|
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
|
||||||
|
|
||||||
ARG DOCKER_VERSION=24.0.6
|
ARG DOCKER_VERSION=29.1.3
|
||||||
ARG DOCKER_COMPOSE_VERSION=1.21.0
|
ARG DOCKER_COMPOSE_VERSION=2.40.3
|
||||||
ARG DOCKER_BUILDX_VERSION=0.30.1
|
ARG DOCKER_BUILDX_VERSION=0.30.1
|
||||||
RUN curl -fsSL https://download.docker.com/linux/static/stable/`uname -m`/docker-$DOCKER_VERSION.tgz \
|
RUN curl -fsSL https://download.docker.com/linux/static/stable/$(uname -m)/docker-$DOCKER_VERSION.tgz \
|
||||||
| tar --strip-components=1 -xz -C /usr/local/bin docker/docker && \
|
| tar --strip-components=1 -xz -C /usr/local/bin docker/docker
|
||||||
curl -fsSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
|
|
||||||
|
ADD https://download.docker.com/linux/debian/dists/bookworm/pool/stable/amd64/docker-compose-plugin_$DOCKER_COMPOSE_VERSION-1~debian.12~bookworm_amd64.deb .
|
||||||
|
RUN gdebi --n ./docker-compose-plugin_2.40.3-1~debian.12~bookworm_amd64.deb
|
||||||
|
|
||||||
# Enable buildx plugin
|
# Enable buildx plugin
|
||||||
## buildx is released as amd64, and uname calls it x86_64
|
## buildx is released as amd64, and uname calls it x86_64
|
||||||
@@ -24,7 +26,7 @@ RUN uname -m > /tmp/arch \
|
|||||||
&& sed -i 's/x86_64/amd64/g' /tmp/arch \
|
&& sed -i 's/x86_64/amd64/g' /tmp/arch \
|
||||||
&& mkdir -p /usr/libexec/docker/cli-plugins/
|
&& mkdir -p /usr/libexec/docker/cli-plugins/
|
||||||
|
|
||||||
RUN curl -fsSL https://github.com/docker/buildx/releases/download/v$DOCKER_BUILDX_VERSION/buildx-v$DOCKER_BUILDX_VERSION.linux-`cat /tmp/arch` > /usr/libexec/docker/cli-plugins/docker-buildx
|
RUN curl -fsSL "https://github.com/docker/buildx/releases/download/v$DOCKER_BUILDX_VERSION/buildx-v$DOCKER_BUILDX_VERSION.linux-$(cat /tmp/arch)" > /usr/libexec/docker/cli-plugins/docker-buildx
|
||||||
RUN chmod +x /usr/libexec/docker/cli-plugins/docker-buildx \
|
RUN chmod +x /usr/libexec/docker/cli-plugins/docker-buildx \
|
||||||
&& docker buildx install \
|
&& docker buildx install \
|
||||||
&& rm /tmp/arch
|
&& rm /tmp/arch
|
||||||
@@ -34,16 +36,17 @@ RUN chmod +x /usr/libexec/docker/cli-plugins/docker-buildx \
|
|||||||
# --driver docker-container \
|
# --driver docker-container \
|
||||||
# --bootstrap --use
|
# --bootstrap --use
|
||||||
|
|
||||||
RUN groupadd -g 988 docker # 988 matches the docker group on candace
|
# gid 988 matches the docker group on candace
|
||||||
RUN usermod -aG docker jenkins
|
RUN groupadd -g 988 docker && \
|
||||||
|
usermod -aG docker jenkins
|
||||||
|
|
||||||
COPY ca-chain.crt /usr/local/share/ca-certificates/ca-chain.crt
|
COPY ca-chain.crt /usr/local/share/ca-certificates/ca-chain.crt
|
||||||
RUN /usr/sbin/update-ca-certificates
|
RUN /usr/sbin/update-ca-certificates
|
||||||
|
|
||||||
USER jenkins
|
USER jenkins
|
||||||
|
|
||||||
RUN mkdir $HOME/.ssh/
|
RUN mkdir "$HOME/.ssh/" && \
|
||||||
RUN touch $HOME/.ssh/known_hosts
|
touch $HOME/.ssh/known_hosts && \
|
||||||
RUN ssh-keyscan github.com >> ~/.ssh/known_hosts
|
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/jenkins-agent"]
|
ENTRYPOINT ["/usr/local/bin/jenkins-agent"]
|
||||||
|
|||||||
Reference in New Issue
Block a user