Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AF-209: Update docker and leverage it for compose command #401

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The changelog is applicable from version `1.0.0` onwards.
- APPCLI-112: Autovalidate config file when a `.schema.json` file is provided.
- APPCLI-115: Enable automerge for dependabot PRs.
- APPCLI-116: Set Ruff as the linter and formatter.
- AF-209: Build the docker-compose plugin into the appcli image.

### Fixed

Expand Down
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,24 @@ FROM alpine:3.15.0 AS docker-binary-download

WORKDIR /tmp

# Download and extract the static docker binary
RUN \
wget -q https://download.docker.com/linux/static/stable/x86_64/docker-20.10.6.tgz \
&& tar xf docker-20.10.6.tgz
# List required versions for docker and compose.
ENV DOCKER_VERSION=24.0.7
ENV DOCKER_COMPOSE_VERSION=2.23.3

# Download docker and compose.
RUN wget -q https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
&& tar xf docker-${DOCKER_VERSION}.tgzv \
&& wget -q https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64 \
&& wget -q https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64.sha256 \
&& sha256sum -c docker-compose-linux-x86_64.sha256 \
&& chmod +x docker-compose-linux-x86_64

FROM python:3.10.2-slim-bullseye

ENV LANG=C.UTF-8

COPY --from=docker-binary-download /tmp/docker/docker /usr/bin
COPY --from=docker-binary-download /tmp/docker-compose-linux-x86_64 /usr/local/lib/docker/cli-plugins/docker-compose

RUN \
# set timezone to UTC by default
Expand Down
3 changes: 2 additions & 1 deletion appcli/orchestrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ def execute_compose(
CompletedProcess: The completed process and its exit code.
"""
docker_compose_command = [
"docker-compose",
"docker",
"compose",
"--project-name",
cli_context.get_project_name(),
]
Expand Down
Loading