Skip to content

Commit

Permalink
Add Dockerfile for image
Browse files Browse the repository at this point in the history
  • Loading branch information
goproslowyo committed Oct 3, 2023
1 parent fa64fe7 commit 6161c94
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build Docker image
run: docker build -t ghcr.io/${{ github.repository }}:latest .

- name: Push Docker image to GHCR
run: docker push ghcr.io/${{ github.repository }}:latest
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Build the python code into a Chainguard python image
FROM cgr.dev/chainguard/python:latest-dev as builder
RUN pip install --no-cache-dir --upgrade requests
FROM cgr.dev/chainguard/python:latest
WORKDIR /app
COPY --from=builder /home/nonroot/.local/lib/python3.11/site-packages /home/nonroot/.local/lib/python3.11/site-packages
COPY *.py /app/
ENTRYPOINT [ "python", "/app/box-to-docs.py" ]

0 comments on commit 6161c94

Please sign in to comment.