File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1- FROM registry.fedoraproject.org/fedora:latest
1+ FROM registry.fedoraproject.org/fedora:latest AS base
22
33LABEL maintainer="James Jones <jamjon3@gmail.com>"
44LABEL description="This project illustrates a python app that uses an API \
@@ -7,6 +7,9 @@ to derive a download URL and download the target file."
77# Install some dependencies
88RUN dnf install -y rubygems ruby-devel gcc gcc-c++ make \
99 libffi-devel python3 python3-pip python3-virtualenv python-unversioned-command
10+
11+ FROM base AS build
12+
1013WORKDIR /output
1114
1215# Copy over python related files
@@ -24,13 +27,10 @@ RUN source venv/bin/activate \
2427RUN source venv/bin/activate \
2528 && exec python build.py
2629
27- # Move the binary into /usr/bin
28- RUN mv dist/getlatestdownloadbinary /usr/bin/getlatestdownloadbinary
30+ FROM base AS final
2931
30- WORKDIR /
31-
32- # Clear out all the build files and virtual environment for Python
33- RUN rm -Rf /output
32+ # Move the binary into /usr/bin
33+ COPY --from=build --chown=root:root /output/dist/getlatestdownloadbinary /usr/bin/getlatestdownloadbinary
3434
3535# Setup the entrypoint script
3636COPY entrypoint.sh /usr/bin/
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ as well as another small class for downloading te release binary.
2323Uses a docker container to 'build' the 'Option 1' basic app into a binary inside a container
2424using:
2525
26- ``` docker build --tag sample . ```
26+ ``` docker build --target final -- tag sample . ```
2727
2828This builds a container with the PyInstaller binary setup with an entrypoint
2929so it can be executed without specifying the binary:
Original file line number Diff line number Diff line change 1- __version__ = '1.0.0 '
1+ __version__ = '1.0.1 '
You can’t perform that action at this time.
0 commit comments