From 1f2874fb4474e6dbfc11c6a6ed52a018ad171065 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 7 Oct 2022 18:16:33 -0400 Subject: [PATCH] fix dockerfile build Fixes #25 --- .github/workflows/ci-docker.yml | 2 +- Dockerfile | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index f4a5069..8669de6 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -45,7 +45,7 @@ jobs: - name: Lint Dockerfile uses: actions/checkout@v3 - - uses: hadolint/hadolint-action@v2.1.0 + - uses: hadolint/hadolint-action@v2.0.0 # 2.1.0 sometimes errors without any output with: dockerfile: ./Dockerfile diff --git a/Dockerfile b/Dockerfile index e464b30..754ad65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # buildstage -FROM python:2.7.18-alpine3.11 as buildstage +FROM python:2.7.18-slim-buster as buildstage # build args ARG BUILD_VERSION @@ -15,12 +15,22 @@ WORKDIR /build/ # copy repo COPY . . -RUN python # update pip \ - -m pip --no-python-version-warning --disable-pip-version-check install --upgrade pip==20.3.4 setuptools \ - && python -m pip install --upgrade -r requirements-dev.txt # install dev requirements \ - && python ./scripts/install_requirements.py # install plugin requirements \ - && python ./scripts/build_plist.py # build plist \ - && rm -r ./scripts/ # remove scripts dir +RUN \ + # update Alpine packages + apt-get update && apt-get -y install \ + # install git -> required for pip to install from git + git=1:2.20.1* \ + && rm -rf /var/lib/apt/lists/* \ + # update python/pip + && python -m pip --no-python-version-warning --disable-pip-version-check install --upgrade pip==20.3.4 setuptools \ + # install build requirements + && python -m pip install --upgrade -r requirements-dev.txt \ + # install plugin requirements + && python ./scripts/install_requirements.py \ + # build plist file + && python ./scripts/build_plist.py \ + # remove scripts directory + && rm -rf ./scripts/ # single layer deployed image FROM scratch