Add 'slim' container (#231)

This commit is contained in:
Joel Challis
2026-06-29 04:06:02 +01:00
committed by GitHub
parent af2ef5d90f
commit 5e57fdefe0
4 changed files with 45 additions and 5 deletions
+1
View File
@@ -39,4 +39,5 @@ jobs:
uses: docker/build-push-action@v7
with:
context: .
target: full
platforms: linux/amd64,linux/arm64
+16 -2
View File
@@ -24,7 +24,7 @@ jobs:
with:
fetch-depth: 0
- name: 'Get Previous tag'
- name: Get Previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v2"
@@ -45,11 +45,25 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and Push to Docker Hub
- name: Build and Push slim to Docker Hub
uses: docker/build-push-action@v7
with:
context: .
push: true
target: slim
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/qmk/qmk_cli:slim
qmkfm/qmk_cli:slim
ghcr.io/qmk/qmk_cli:${{ steps.previoustag.outputs.tag }}-slim
qmkfm/qmk_cli:${{ steps.previoustag.outputs.tag }}-slim
- name: Build and Push full to Docker Hub
uses: docker/build-push-action@v7
with:
context: .
push: true
target: full
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/qmk/qmk_cli:latest
+15 -1
View File
@@ -74,11 +74,25 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and Push to Docker Hub
- name: Build and Push slim to Docker Hub
uses: docker/build-push-action@v7
with:
context: .
push: true
target: slim
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/qmk/qmk_cli:slim
qmkfm/qmk_cli:slim
ghcr.io/qmk/qmk_cli:${{ env.NEW_CLI_VERSION }}-slim
qmkfm/qmk_cli:${{ env.NEW_CLI_VERSION }}-slim
- name: Build and Push full to Docker Hub
uses: docker/build-push-action@v7
with:
context: .
push: true
target: full
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/qmk/qmk_cli:latest
+13 -2
View File
@@ -1,4 +1,4 @@
FROM ghcr.io/qmk/qmk_base_container:latest as builder
FROM ghcr.io/qmk/qmk_base_container:latest AS builder
# Copy package in
ADD dist /tmp/dist
@@ -21,7 +21,18 @@ RUN python3 -m pip install --upgrade pip setuptools wheel nose2 && \
RUN chmod -R go=u,go-w /opt/uv /opt/qmk
# 2nd stage so we don't have /tmp/dist in the final image
FROM ghcr.io/qmk/qmk_base_container:latest
FROM ghcr.io/qmk/qmk_base_container:latest AS slim
COPY --from=builder /opt/uv /opt/uv
# Do the equivalent of entering the virtual environment
ENV PATH=/opt/uv/tools/qmk/bin:$PATH \
VIRTUAL_ENV=/opt/uv/tools/qmk \
QMK_HOME=/qmk_firmware \
QMK_USERSPACE=/qmk_userspace
# 2nd stage so we don't have /tmp/dist in the final image
FROM ghcr.io/qmk/qmk_base_container:latest AS full
COPY --from=builder /opt/uv /opt/uv
COPY --from=builder /opt/qmk /opt/qmk