Skip to content

Commit

Permalink
adding unprivileged minimal container
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haigh <mhaigh@netapp.com>
  • Loading branch information
MichaelHaigh committed May 14, 2024
1 parent 00b4708 commit 585f7fe
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/manual-docker-min-unprv-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow builds and uploads a the minimal docker image
# It's only meant to be manually invoked when the automated python-docker-publish.yml
# file errors out and the image needs to be rebuilt.

name: Manual Docker Min Build

on:
workflow_dispatch:
inputs:
tag:
description: "docker image tag"
required: true
type: string

jobs:
docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3.3.0
- name: Build and push the Docker image
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERIMAGE_TAG: ${{ inputs.tag }}
run: |
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
docker buildx build . --push --file Dockerfile.minimal-unprivileged \
--tag netapp/astra-toolkits:latest-minimal-unprivileged --tag netapp/astra-toolkits:$DOCKERIMAGE_TAG-minimal-unprivileged \
--platform linux/amd64,linux/arm64
8 changes: 8 additions & 0 deletions Dockerfile.minimal-unprivileged
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.12.3-alpine3.19
RUN apk add --no-cache jq curl
RUN adduser -D worker
USER worker
WORKDIR /home/worker
ENV PATH="/home/worker/.local/bin:${PATH}"
RUN pip install --user actoolkit
CMD ["/bin/sh"]

0 comments on commit 585f7fe

Please sign in to comment.