mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 06:46:15 +00:00
Add docker build, update docs for using docker images
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
ARG PYVERSION
|
||||
FROM docker.io/python:${PYVERSION}
|
||||
|
||||
ARG VERSION
|
||||
RUN pip install pipenv=="${VERSION}"
|
||||
@@ -0,0 +1,13 @@
|
||||
ifneq (,$(wildcard ./.env))
|
||||
include .env
|
||||
export
|
||||
endif
|
||||
|
||||
|
||||
docker-build:
|
||||
echo $(PYVERSION) $(PIPENV)
|
||||
docker build -t $(REGISTRY)/$(ORG)/$(IMG):$(TAG) --build-arg PYVERSION=$(PYVERSION) --build-arg VERSION=$(PIPENV) -f Dockerfile .
|
||||
|
||||
|
||||
docker-push:
|
||||
docker push $(REGISTRY)/$(ORG)/$(IMG):$(TAG)
|
||||
@@ -0,0 +1,7 @@
|
||||
# Public docker images
|
||||
|
||||
Build with:
|
||||
|
||||
```
|
||||
$ make docker-build docker-push TAG=3.11-alpine-v2023-6-26 PYVERSION=3.11-alpine PIPENV=2023.6.26
|
||||
```
|
||||
+2
-3
@@ -14,9 +14,8 @@ This results in a smaller image, which can still run your application.
|
||||
Here is an example `Dockerfile`, which you can use as a starting point for
|
||||
doing a multistage build for your application:
|
||||
|
||||
FROM docker.io/python:3.9 AS builder
|
||||
FROM docker.io/oz123/pipenv:3.11-v2023-6-26 AS builder
|
||||
|
||||
RUN pip install --user pipenv
|
||||
|
||||
# Tell pipenv to create venv in the current directory
|
||||
ENV PIPENV_VENV_IN_PROJECT=1
|
||||
@@ -37,7 +36,7 @@ doing a multistage build for your application:
|
||||
|
||||
RUN /usr/src/.venv/bin/python -c "import requests; print(requests.__version__)"
|
||||
|
||||
FROM docker.io/python:3.9 AS runtime
|
||||
FROM docker.io/python:3.11 AS runtime
|
||||
|
||||
RUN mkdir -v /usr/src/.venv
|
||||
|
||||
|
||||
Reference in New Issue
Block a user