Skip to content

Commit

Permalink
Bump venv to 3.7, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
shauneccles committed Mar 6, 2021
1 parent 081c92f commit 69c7c5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.venv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Create docker image from python3.7-slim
#
# Set up base venv image to start the build
FROM python:3.7-slim AS venv-image
FROM python:3.9-slim AS venv-image
# Create python venv and add it to PATH
RUN python -m venv /ledfx/venv
ENV PATH="/ledfx/venv/bin:$PATH"
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository is very much a work in progress. Feel free to try some of these

### **Dockerfile:**

This file uses the python:3.7-slim image:
This file uses the python:3.9-slim image:

* It first creates a python virtual environment /ledfx/venv
* "activate" the python venv by adding it to the `PATH`
Expand Down Expand Up @@ -53,7 +53,7 @@ This file uses docker's multi-stage build technique to speed up the build proces

While all 4 images will be built initially, we can significantly cut down the build times by using the cached images that won't change regularly. Docker will use the cache up until the point in the Dockerfile that it detects a change. Any lines after that change will be build from scratch.

By creating the venv and compile images in the beggining of the Dockerfile, we can be fairly certain that these dependencies won't change regularly. This cuts down the time required to build by skipping the dependency installation process.
By creating the venv and compile images in the beginning of the Dockerfile, we can be fairly certain that these dependencies won't change regularly. This cuts down the time required to build by skipping the dependency installation process.

1. Create "venv-image"

Expand Down Expand Up @@ -94,29 +94,29 @@ These files take a similar approach to Dockerfile-4stage. They differ in the fac

1. Dockerfile.venv

* Create "venv-image" from python:3.7-slim
* Create "venv-image" from python:3.9-slim
* Create a python venv /ledfx/venv and "activate" it by adding it to the `PATH`
* Install run dependencies with `apt-get`

How to use: `docker build -t thatdonfc/ledfx-venv -f Dockerfile.venv .`
How to use: `docker build -t ledfx-venv -f Dockerfile.venv .`

2. Dockerfile.compile

* Create "compile-image" from "venv-image" named thatdonfc/ledfx-venv
* Create "compile-image" from "venv-image" named ledfx-venv
* Activate the venv by adding it to the `PATH`
* Install build dependencies with `apt-get`
* Install ledfx-dev with `pip`

How to use: `docker build -t thatdonfc/ledfx-compile -f Dockerfile.compile .`
How to use: `docker build -t ledfx-compile -f Dockerfile.compile .`

3. Dockerfile.build

* Create build image from "venv-image" named thatdonfc/ledfx-venv
* `COPY` /ledfx/venv from "compile-image" named thatdonfc/ledfx-compile
* Create build image from "venv-image" named ledfx/ledfx-venv
* `COPY` /ledfx/venv from "compile-image" named ledfx/ledfx-compile
* Remove all lists from /var/lib/apt/lists/
* Add ledfx user and create a home folder
* Set `WORKDIR` to ledfx home directory and change `USER` to ledfx
* `EXPOSE` ports 8888 and 5353
* Launch ledfx

How to use: `docker build -t thatdonfc/ledfx-build -f Dockerfile.build .`
How to use: `docker build -t ledfx-build -f Dockerfile.build .`

0 comments on commit 69c7c5a

Please sign in to comment.