-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to build and automate container creation
This is based on the Dockerfile provided at #284 with some tweaks. Makefile is adjusted to allow easy experimentation, but the primary work here uses github actions.
- Loading branch information
Showing
3 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: docker | ||
|
||
#on: | ||
# release: | ||
# types: [published] | ||
|
||
on: [push] | ||
|
||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: cdent/gabbi | ||
tags: | | ||
type=pep440,pattern={{version}} | ||
type=pep440,pattern={{major}}.{{minor}} | ||
type=pep440,pattern={{major}} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | ||
GABBI_VERSION=${{fromJSON(steps.meta.outputs.json).tags[0]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3-alpine | ||
MAINTAINER Chris Dent <cdent@anticdent.org> | ||
|
||
ARG GABBI_VERSION | ||
RUN python -m venv /app | ||
COPY . /app/ | ||
RUN cd /app && PBR_VERSION=${GABBI_VERSION} /app/bin/pip --no-cache-dir install . | ||
|
||
ENTRYPOINT ["/app/bin/python", "-m", "gabbi.runner"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters