Skip to content

Commit

Permalink
Add :debug docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklauslittle-gov committed May 6, 2022
1 parent 9c85f96 commit 5549335
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ jobs:
github token: ${{ secrets.GITHUB_TOKEN }}

- name: Test Dockerfile
run: docker build . --tag 76eddge/k8psh --target deploy
run: |
docker build . --tag 76eddge/k8psh --target deploy
docker run -t --rm 76eddge/k8psh
docker build . --tag 76eddge/k8psh:debug --target deploy-debug
docker run -t --rm 76eddge/k8psh:debug
env:
DOCKER_BUILDKIT: 1

Expand Down Expand Up @@ -91,7 +95,9 @@ jobs:

- name: Push Docker Images
if: startsWith(github.ref, 'refs/tags/')
run: docker buildx build . --tag 76eddge/k8psh --tag 76eddge/k8psh:${GITHUB_REF/refs\/tags\//} --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --target deploy --push
run: |
docker buildx build . --tag 76eddge/k8psh --tag 76eddge/k8psh:${GITHUB_REF/refs\/tags\//} --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --target deploy --push
docker buildx build . --tag 76eddge/k8psh:debug --tag 76eddge/k8psh:${GITHUB_REF/refs\/tags\//}-debug --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --target deploy-debug --push
windows:
runs-on: windows-latest
Expand All @@ -101,9 +107,7 @@ jobs:
- run: choco install cmake ninja

- name: Enable MSVC
uses: ilammy/msvc-dev-cmd@v1.9.0
with:
toolset: "14.0"
uses: ilammy/msvc-dev-cmd@v1

- name: Build & Test
run: |
Expand Down
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,26 @@ WORKDIR /root/k8psh
RUN cmake -B build -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/k8psh-install -G Ninja .
RUN cmake --build build --target check install/strip

RUN cmake -B build_debug -DCMAKE_BUILD_TYPE=MinSizeRel '-DCMAKE_CXX_FLAGS=-Os -DDEBUG' -DCMAKE_INSTALL_PREFIX=/k8psh-debug-install -G Ninja .
RUN cmake --build build_debug --target check install/strip

# Build a minimal image
FROM scratch AS deploy

COPY --from=build /k8psh-install/ /

WORKDIR /root
RUN ["/bin/k8psh", "--version"]

ENTRYPOINT ["/bin/k8psh"]
CMD ["--version"]

# Build a minimal debug image
FROM scratch AS deploy-debug

COPY --from=build /k8psh-debug-install/ /

WORKDIR /root
ENV K8PSH_DEBUG=all

ENTRYPOINT ["/bin/k8psh"]
CMD ["--version"]

0 comments on commit 5549335

Please sign in to comment.