Skip to content

Commit

Permalink
Adds a Dockerfile and adds instructions in GoReleaser config to build…
Browse files Browse the repository at this point in the history
… and publish `mllint` Docker images for Python 3.6, 3.7, 3.8 and 3.9
  • Loading branch information
bvobart committed May 26, 2021
1 parent 1f9d897 commit 2312297
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This .goreleaser.yml file configures GoReleaser to properly and reproducibly build `mllint` for Linux, MacOS and Windows
# It will also create a Docker container from the built executable and the given Dockerfile.
before:
hooks:
- go mod tidy
Expand All @@ -14,6 +15,42 @@ builds:
- -s -w -X github.com/bvobart/mllint/commands.version={{.Version}} -X github.com/bvobart/mllint/commands.commit={{.Commit}} -X github.com/bvobart/mllint/commands.date={{.CommitDate}}
mod_timestamp: '{{ .CommitTimestamp }}'

# Build Docker containers of `mllint` for Python versions [3.6, 3.7, 3.8, 3.9]
dockers:
- image_templates:
- bvobart/mllint:latest-py3.6
- bvobart/mllint:{{.Version}}-py3.6
build_flag_templates:
- --build-arg=python_version=3.6
extra_files:
- build/requirements-tools.txt

- image_templates:
- bvobart/mllint:latest-py3.7
- bvobart/mllint:{{.Version}}-py3.7
build_flag_templates:
- --build-arg=python_version=3.7
extra_files:
- build/requirements-tools.txt

- image_templates:
- bvobart/mllint:latest-py3.8
- bvobart/mllint:{{.Version}}-py3.8
build_flag_templates:
- --build-arg=python_version=3.8
extra_files:
- build/requirements-tools.txt

- image_templates:
- bvobart/mllint:latest
- bvobart/mllint:{{.Version}}
- bvobart/mllint:latest-py3.9
- bvobart/mllint:{{.Version}}-py3.9
build_flag_templates:
- --build-arg=python_version=3.9
extra_files:
- build/requirements-tools.txt

archives:
- format: tar.gz
format_overrides:
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG python_version=3.9
FROM python:${python_version}-alpine
WORKDIR /mllint

RUN apk update && apk add --no-cache gcc musl-dev python3-dev libffi-dev libgit2-dev

COPY build/requirements-tools.txt .
RUN pip install --no-cache-dir -r requirements-tools.txt

COPY mllint .

WORKDIR /app
VOLUME /app
ENTRYPOINT [ "/mllint/mllint" ]

0 comments on commit 2312297

Please sign in to comment.