Skip to content

Commit e1706e7

Browse files
committed
Add a slim image without the additional deps
1 parent 737dbb5 commit e1706e7

File tree

2 files changed

+49
-8
lines changed

2 files changed

+49
-8
lines changed

.github/workflows/python-interpreter.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ jobs:
7373
OWNER_LOWER=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]')
7474
echo "image_name=ghcr.io/$OWNER_LOWER/afm-langchain-interpreter" >> $GITHUB_OUTPUT
7575
76-
- name: Build and push Docker image
76+
- name: Build and push full image
7777
uses: docker/build-push-action@v5
7878
with:
7979
context: python-interpreter
8080
push: true
8181
platforms: linux/amd64,linux/arm64
82+
build-args: VARIANT=full
8283
tags: |
8384
${{ steps.meta.outputs.image_name }}:latest
8485
${{ steps.meta.outputs.image_name }}:${{ github.sha }}
@@ -90,3 +91,22 @@ jobs:
9091
annotations: |
9192
index:org.opencontainers.image.source=https://github.com/${{ github.repository }}
9293
index:org.opencontainers.image.licenses=Apache-2.0
94+
95+
- name: Build and push slim image
96+
uses: docker/build-push-action@v5
97+
with:
98+
context: python-interpreter
99+
push: true
100+
platforms: linux/amd64,linux/arm64
101+
build-args: VARIANT=slim
102+
tags: |
103+
${{ steps.meta.outputs.image_name }}:slim
104+
${{ steps.meta.outputs.image_name }}:${{ github.sha }}-slim
105+
labels: |
106+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
107+
org.opencontainers.image.revision=${{ github.sha }}
108+
org.opencontainers.image.title=AFM LangChain Interpreter (Slim)
109+
org.opencontainers.image.licenses=Apache-2.0
110+
annotations: |
111+
index:org.opencontainers.image.source=https://github.com/${{ github.repository }}
112+
index:org.opencontainers.image.licenses=Apache-2.0

.github/workflows/release-docker.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,23 @@ jobs:
5757
# GHCR requires lowercase repository names
5858
OWNER_LOWER=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]')
5959
FULL_IMAGE="ghcr.io/$OWNER_LOWER/$IMAGE_NAME"
60-
TAGS="$FULL_IMAGE:v$VERSION"
61-
if [ "$UPDATE_LATEST" = "true" ]; then
62-
TAGS="$TAGS,$FULL_IMAGE:latest"
63-
fi
64-
echo "TAGS=$TAGS" >> $GITHUB_OUTPUT
60+
TAGS_FULL="$FULL_IMAGE:v$VERSION"
61+
[ "$UPDATE_LATEST" = "true" ] && TAGS_FULL="$TAGS_FULL,$FULL_IMAGE:latest"
62+
echo "TAGS_FULL=$TAGS_FULL" >> $GITHUB_OUTPUT
63+
64+
TAGS_SLIM="$FULL_IMAGE:v$VERSION-slim"
65+
[ "$UPDATE_LATEST" = "true" ] && TAGS_SLIM="$TAGS_SLIM,$FULL_IMAGE:slim"
66+
echo "TAGS_SLIM=$TAGS_SLIM" >> $GITHUB_OUTPUT
6567
echo "FULL_IMAGE=$FULL_IMAGE" >> $GITHUB_OUTPUT
6668
67-
- name: Build and push Docker image
69+
- name: Build and push full image
6870
uses: docker/build-push-action@v5
6971
with:
7072
context: ${{ inputs.context }}
7173
push: true
7274
platforms: linux/amd64,linux/arm64
73-
tags: ${{ steps.docker-tags.outputs.TAGS }}
75+
build-args: VARIANT=full
76+
tags: ${{ steps.docker-tags.outputs.TAGS_FULL }}
7477
labels: |
7578
org.opencontainers.image.source=https://github.com/${{ github.repository }}
7679
org.opencontainers.image.version=${{ inputs.version }}
@@ -81,6 +84,24 @@ jobs:
8184
index:org.opencontainers.image.source=https://github.com/${{ github.repository }}
8285
index:org.opencontainers.image.licenses=Apache-2.0
8386
87+
- name: Build and push slim image
88+
uses: docker/build-push-action@v5
89+
with:
90+
context: ${{ inputs.context }}
91+
push: true
92+
platforms: linux/amd64,linux/arm64
93+
build-args: VARIANT=slim
94+
tags: ${{ steps.docker-tags.outputs.TAGS_SLIM }}
95+
labels: |
96+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
97+
org.opencontainers.image.version=${{ inputs.version }}
98+
org.opencontainers.image.revision=${{ github.sha }}
99+
org.opencontainers.image.title=${{ inputs.image_title }} (Slim)
100+
org.opencontainers.image.licenses=Apache-2.0
101+
annotations: |
102+
index:org.opencontainers.image.source=https://github.com/${{ github.repository }}
103+
index:org.opencontainers.image.licenses=Apache-2.0
104+
84105
- name: Scan Docker image for vulnerabilities
85106
uses: aquasecurity/trivy-action@0.34.0
86107
with:

0 commit comments

Comments
 (0)