ci: change dockerfile build

This commit is contained in:
Florian Bezannier
2022-04-07 10:03:24 +02:00
parent b9f705da89
commit cc02115e1c
4 changed files with 19 additions and 11 deletions
+11
View File
@@ -23,7 +23,12 @@ jobs:
run: |
poetry version $(git describe --tags --abbrev=0)
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
- uses: actions/upload-artifact@master
with:
name: wheel-package
path: dist/psa_car_controller-$(git describe --tags --abbrev=0)-py3-none-any.whl
push_to_registry:
needs: create_release
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
@@ -41,6 +46,11 @@ jobs:
TAGS="${DOCKER_IMAGE}:${VERSION}"
fi
echo ::set-output name=tags::${TAGS}
echo "PSACC_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- uses: actions/download-artifact@master
with:
name: wheel-package
path: dist/psa_car_controller-$(git describe --tags --abbrev=0)-py3-none-any.whl
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
@@ -64,6 +74,7 @@ jobs:
push: true
tags: ${{ steps.prep.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: PSACC_VERSION=${{ env.PSACC_VERSION }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
+5 -8
View File
@@ -1,15 +1,13 @@
ARG PYTHON_DEP='python3 python3-wheel python3-typing-extensions python3-pandas python3-six python3-dateutil python3-brotli python3-pycryptodome libatlas3-base python3-cryptography python3-scipy androguard python3-flask python3-paho-mqtt python3-ruamel.yaml ca-certificates python3-numpy'
ARG DEBIAN_FRONTEND=noninteractive
FROM debian:bullseye-slim AS builder
ARG PSACC_VERSION="0.0.0"
ARG PYTHON_DEP
RUN BUILD_DEP='python3-pip python3-setuptools python3-dev libblas-dev liblapack-dev gfortran libffi-dev libxml2-dev libxslt1-dev make automake gcc g++ subversion' ; \
apt-get update && apt-get install -y --no-install-recommends $BUILD_DEP $PYTHON_DEP;
RUN pip3 install --upgrade pip
RUN pip3 install poetry
COPY poetry.lock pyproject.toml ./
RUN poetry build
RUN pip3 install --no-deps --no-cache-dir --ignore-installed dist/psa_car_controller-0.0.0-py3-none-any.whl
RUN pip3 install --upgrade pip && mkdir psa-car-controller && pip3 install poetry
COPY ./dist/psa_car_controller-${PSACC_VERSION}-py3-none-any.whl .
RUN pip3 install --no-cache-dir psa_car_controller-${PSACC_VERSION}-py3-none-any.whl
EXPOSE 5000
FROM debian:bullseye-slim
@@ -19,10 +17,9 @@ ENV PSACC_BASE_PATH=/ PSACC_PORT=5000 PSACC_OPTIONS="-c -r --web-conf" PSACC_CON
COPY --from=builder /var/lib/apt /var/lib/apt
COPY --from=builder /var/cache/apt/ /var/cache/apt/
COPY --from=builder /usr/local/lib /usr/local/lib
COPY --from=builder /usr/local/bin/ /usr/local/bin/
RUN apt-get install -y --no-install-recommends $PYTHON_DEP && \
apt-get clean ; \
rm -rf /var/lib/apt/lists/*
RUN mkdir app
COPY psa_car_controller /app/psa_car_controller
COPY /docker_files/init.sh /init.sh
CMD /init.sh
+1 -1
View File
@@ -2,4 +2,4 @@
echo "Containerised psa_car_controller loading..."
cd "$PSACC_CONFIG_DIR"
ARGS="-p $PSACC_PORT -l 0.0.0.0 -b $PSACC_BASE_PATH $PSACC_OPTIONS"
python3 -u -m psa_car_controller $ARGS
psa-car-controller $ARGS
+2 -2
View File
@@ -24,12 +24,12 @@ ConfigUpdater = ">=3.0"
pandas = ">=0.23"
oauth2-client = "^1.2.1"
requests = "^2.27.1"
pytz = "^2021.3"
pytz = "^2021.0"
argparse = "^1.4.0"
geojson = "^2.5.0"
reverse-geocode = "^1.4.1"
androguard = "^3.3.5"
pycryptodomex = "^3.14.1"
pycryptodomex = "^3.9.0"
pydantic = "^1.9.0"
"ruamel.yaml" = ">=0.15.0"
certifi = ">=14.05.14"