Skip to content

Commit 4e8bcf1

Browse files
committed
Add docker build, update docs for using docker images
1 parent b1e3128 commit 4e8bcf1

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

docker/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ARG PYVERSION
2+
FROM docker.io/python:${PYVERSION}
3+
4+
ARG VERSION
5+
RUN pip install pipenv=="${VERSION}"

docker/Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ifneq (,$(wildcard ./.env))
2+
include .env
3+
export
4+
endif
5+
6+
7+
docker-build:
8+
echo $(PYVERSION) $(PIPENV)
9+
docker build -t $(REGISTRY)/$(ORG)/$(IMG):$(TAG) --build-arg PYVERSION=$(PYVERSION) --build-arg VERSION=$(PIPENV) -f Dockerfile .
10+
11+
12+
docker-push:
13+
docker push $(REGISTRY)/$(ORG)/$(IMG):$(TAG)

docker/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Public docker images
2+
3+
Build with:
4+
5+
```
6+
$ make docker-build docker-push TAG=3.11-alpine-v2023-6-26 PYVERSION=3.11-alpine PIPENV=2023.6.26
7+
```

docs/docker.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ This results in a smaller image, which can still run your application.
1414
Here is an example `Dockerfile`, which you can use as a starting point for
1515
doing a multistage build for your application:
1616

17-
FROM docker.io/python:3.9 AS builder
17+
FROM docker.io/oz123/pipenv:3.11-v2023-6-26 AS builder
1818

19-
RUN pip install --user pipenv
2019

2120
# Tell pipenv to create venv in the current directory
2221
ENV PIPENV_VENV_IN_PROJECT=1
@@ -37,7 +36,7 @@ doing a multistage build for your application:
3736

3837
RUN /usr/src/.venv/bin/python -c "import requests; print(requests.__version__)"
3938

40-
FROM docker.io/python:3.9 AS runtime
39+
FROM docker.io/python:3.11 AS runtime
4140

4241
RUN mkdir -v /usr/src/.venv
4342

0 commit comments

Comments
 (0)