chore: move from alpine to slim base image

This commit is contained in:
Robert Kaussow 2022-01-08 16:06:57 +01:00
parent 635c1f4942
commit 2e623cee77
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
5 changed files with 34 additions and 45 deletions

View File

@ -136,7 +136,7 @@ local PipelineBuildPackage = {
},
{
name: 'checksum',
image: 'alpine',
image: 'thegeeklab/alpine-tools',
commands: [
'cd dist/ && sha256sum * > ../sha256sum.txt',
],
@ -197,35 +197,24 @@ local PipelineBuildPackage = {
};
local PipelineBuildContainer(arch='amd64') = {
local build = if arch == 'arm' then [{
name: 'build',
image: 'python:3.10-alpine',
commands: [
'apk add -Uq --no-cache build-base openssl-dev libffi-dev musl-dev python3-dev git cargo',
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
environment: {
CARGO_NET_GIT_FETCH_WITH_CLI: true,
},
}] else [{
name: 'build',
image: 'python:3.10',
commands: [
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
}],
kind: 'pipeline',
name: 'build-container-' + arch,
platform: {
os: 'linux',
arch: arch,
},
steps: build + [
steps: [
{
name: 'build',
image: 'python:3.10',
commands: [
'apt update',
'apt install -y --no-install-recommends rustc cargo',
'git fetch -tq',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
},
{
name: 'dryrun',
image: 'thegeeklab/drone-docker:19',

View File

@ -156,7 +156,7 @@ steps:
- poetry build
- name: checksum
image: alpine
image: thegeeklab/alpine-tools
commands:
- cd dist/ && sha256sum * > ../sha256sum.txt
@ -223,6 +223,8 @@ steps:
- name: build
image: python:3.10
commands:
- apt update
- apt install -y --no-install-recommends rustc cargo
- git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
@ -301,6 +303,8 @@ steps:
- name: build
image: python:3.10
commands:
- apt update
- apt install -y --no-install-recommends rustc cargo
- git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
@ -377,14 +381,13 @@ platform:
steps:
- name: build
image: python:3.10-alpine
image: python:3.10
commands:
- apk add -Uq --no-cache build-base openssl-dev libffi-dev musl-dev python3-dev git cargo
- apt update
- apt install -y --no-install-recommends rustc cargo
- git fetch -tq
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
environment:
CARGO_NET_GIT_FETCH_WITH_CLI: true
- name: dryrun
image: thegeeklab/drone-docker:19
@ -545,6 +548,6 @@ depends_on:
---
kind: signature
hmac: f7c56c0b77bc2b2c3548e91260baa15df3101e917537e5fac2a24e6feff12835
hmac: 363bdc2ad06ada0804885998e33a5db6ba2d0b73a9faa9e1fc65ce87601bcb46
...

View File

@ -1,4 +1,4 @@
FROM python:3.10-alpine@sha256:bed0a5fe5b7d996b0678abf4fb2f0d5f3d5078cda951ccdc068ffbddb555e727
FROM amd64/python:3.10-slim
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
@ -11,13 +11,12 @@ ENV PY_COLORS=1
ADD dist/docker_autotag-*.whl /
RUN apk --update add --virtual .build-deps build-base libffi-dev openssl-dev && \
apk --update add git && \
RUN apt update && apt install -y git && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir $(find / -name "docker_autotag-*.whl") && \
apk del .build-deps && \
rm -f docker_autotag-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /root/.cache/
USER root

View File

@ -1,4 +1,4 @@
FROM arm32v7/python:3.10-alpine@sha256:6ee764ac3084eb137c2c0a16b89a5a93606633bf22a46aea61ee45f8eab1db3a
FROM arm32v7/python:3.10-slim
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
@ -11,13 +11,12 @@ ENV PY_COLORS=1
ADD dist/docker_autotag-*.whl /
RUN apk --update add --virtual .build-deps build-base libffi-dev openssl-dev && \
apk --update add git && \
RUN apt update && apt install -y git && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir $(find / -name "docker_autotag-*.whl") && \
apk del .build-deps && \
rm -f docker_autotag-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /root/.cache/
USER root

View File

@ -1,4 +1,4 @@
FROM arm64v8/python:3.10-alpine@sha256:2c3e3fbd7e36aca4eee1e95e0d7c12022e580053dc61f7a86117bc666203686e
FROM arm64v8/python:3.10-slim
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
@ -11,13 +11,12 @@ ENV PY_COLORS=1
ADD dist/docker_autotag-*.whl /
RUN apk --update add --virtual .build-deps build-base libffi-dev openssl-dev && \
apk --update add git && \
RUN apt update && apt install -y git && \
pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir $(find / -name "docker_autotag-*.whl") && \
apk del .build-deps && \
rm -f docker_autotag-*.whl && \
rm -rf /var/cache/apk/* && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /root/.cache/
USER root