From dbc87e7a0d204037b2e7ccc457fad0d3f2919670 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Tue, 27 Apr 2021 16:57:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7Minor=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- slides/containers/Dockerfile_Tips.md | 4 ++-- slides/containers/Multi_Stage_Builds.md | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/slides/containers/Dockerfile_Tips.md b/slides/containers/Dockerfile_Tips.md index 6b402906..6e8082fe 100644 --- a/slides/containers/Dockerfile_Tips.md +++ b/slides/containers/Dockerfile_Tips.md @@ -66,9 +66,9 @@ Adding the dependencies as a separate step means that Docker can cache more effi ```bash FROM python -COPY requirements.txt /tmp/requirements.txt -RUN pip install -qr /tmp/requirements.txt WORKDIR /src +COPY requirements.txt . +RUN pip install -qr requirements.txt COPY . . EXPOSE 5000 CMD ["python", "app.py"] diff --git a/slides/containers/Multi_Stage_Builds.md b/slides/containers/Multi_Stage_Builds.md index d2bbd782..f944f17f 100644 --- a/slides/containers/Multi_Stage_Builds.md +++ b/slides/containers/Multi_Stage_Builds.md @@ -298,21 +298,20 @@ virtually "free." ## Build targets -* We can also tag an intermediary stage with `docker build --target STAGE --tag NAME` +* We can also tag an intermediary stage with the following command: + ```bash + docker build --target STAGE --tag NAME + ``` * This will create an image (named `NAME`) corresponding to stage `STAGE` * This can be used to easily access an intermediary stage for inspection - (Instead of parsing the output of `docker build` to find out the image ID) + (instead of parsing the output of `docker build` to find out the image ID) * This can also be used to describe multiple images from a single Dockerfile - (Instead of using multiple Dockerfiles, which could go out of sync) - -* Sometimes, we want to inspect a specific intermediary build stage. - -* Or, we want to describe multiple images using a single Dockerfile. + (instead of using multiple Dockerfiles, which could go out of sync) ???