Created
February 2, 2024 14:11
-
-
Save jwillmer/90bb3cfd255f5ef8e088ab10bfa80dde to your computer and use it in GitHub Desktop.
Install docker (compose) in Alpine with fixed version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV DOCKER_VERSION=24.0.7 | |
ENV DOCKER_COMPOSE_VERSION=2.21.0 | |
# Install tooling | |
RUN apk add --update --no-cache bash diffutils curl wget nano git openssh rsync envsubst grep gawk diffutils bind-tools | |
# Install docker | |
RUN curl -sSLf https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz | tar -xzvf - docker/docker && chmod +x docker/* && mv docker/* /bin | |
# Install docker compose | |
RUN mkdir -p ~/.docker/cli-plugins && \ | |
curl -fsSL "https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64" -o ~/.docker/cli-plugins/docker-compose && \ | |
chmod +x ~/.docker/cli-plugins/docker-compose | |
# Provide docker v1 command fallback | |
RUN curl -fsSL -o /usr/local/bin/docker-compose https://github.com/docker/compose-switch/releases/download/v1.0.5/docker-compose-linux-amd64 && \ | |
chmod +x /usr/local/bin/docker-compose | |
# Validate docker commands | |
RUN docker --version && docker compose version && docker-compose version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment