Skip to content

Commit

Permalink
feat: update Dockerfile from bullseye to bookworm (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
gofrolist authored Dec 26, 2023
1 parent f0969b8 commit b92cd85
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: docker/build-push-action@v5.1.0
with:
context: .
file: Dockerfile.buster
file: Dockerfile
push: ${{ github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: docker/build-push-action@v5.1.0
with:
context: .
file: Dockerfile.buster
file: Dockerfile
load: true
tags: ${{ env.DOCKER_IMAGE_NAME }}:test
cache-from: type=gha
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: docker/build-push-action@v5.1.0
with:
context: .
file: Dockerfile.buster
file: Dockerfile
load: true
tags: ${{ env.DOCKER_IMAGE_NAME }}:test
cache-from: type=gha
Expand Down
29 changes: 15 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9.18-alpine3.18 AS builder
FROM python:3.9.18-slim-bookworm AS builder

ARG BUILD_DEPS="\
docker \
Expand All @@ -8,17 +8,17 @@ ARG BUILD_DEPS="\
make \
musl-dev \
openssh-client \
openssl-dev \
"

RUN apk add --update --no-cache ${BUILD_DEPS}

RUN apt-get update && \
apt-get install --no-install-recommends -y ${BUILD_DEPS} && \
rm -rf /var/lib/apt/lists/*

COPY Pipfile* .
RUN pip install pipenv && \
RUN pip install --no-cache-dir pipenv && \
pipenv install --deploy --system

FROM python:3.9.18-alpine3.18 AS runtime
FROM python:3.9.18-slim-bookworm AS runtime

LABEL "maintainer"="Evgenii Vasilenko <gmrnsk@gmail.com>"
LABEL "repository"="https://github.com/gofrolist/molecule-action"
Expand All @@ -29,22 +29,23 @@ LABEL "com.github.actions.color"="green"

COPY --from=builder /usr/local/lib/python3.9/site-packages/ /usr/local/lib/python3.9/site-packages/
COPY --from=builder /usr/local/bin/ansible* \
/usr/local/bin/molecule \
/usr/local/bin/pre-commit* \
/usr/local/bin/yamllint \
/usr/local/bin/
/usr/local/bin/molecule \
/usr/local/bin/pre-commit* \
/usr/local/bin/yamllint \
/usr/local/bin/

ARG PACKAGES="\
docker \
docker.io \
git \
openssh-client \
podman \
rsync \
tini \
"

RUN apk add --update --no-cache ${PACKAGES} && \
rm -rf /root/.cache
RUN apt-get update && \
apt-get install --no-install-recommends -y ${PACKAGES} && \
rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/sbin/tini", "--"]
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD cd ${INPUT_MOLECULE_WORKING_DIR}; molecule ${INPUT_MOLECULE_OPTIONS} ${INPUT_MOLECULE_COMMAND} ${INPUT_MOLECULE_ARGS}
51 changes: 0 additions & 51 deletions Dockerfile.buster

This file was deleted.

0 comments on commit b92cd85

Please sign in to comment.