auto-semver/Dockerfile

34 lines
701 B
Docker
Raw Normal View History

# ======= #
# Builder #
# ======= #
FROM python:3.11-slim as builder
COPY / /semver
RUN pip wheel --no-cache-dir --wheel-dir /wheels /semver
2017-02-23 21:34:12 +01:00
# ======== #
# Finalize #
# ======== #
FROM python:3.11-slim
2019-08-06 21:23:51 +02:00
# Update and install git
RUN apt-get update && apt-get install -y git
# Create user
RUN mkdir /semver && \
groupadd -g 10001 semver && \
useradd -u 10000 -g semver -d /semver semver \
&& chown -R semver:semver /semver
2017-02-23 21:34:12 +01:00
2019-08-06 21:23:51 +02:00
# Prep workspace
RUN mkdir /workspace && \
chown -R semver:semver /workspace
2019-08-06 21:23:51 +02:00
VOLUME /workspace
2017-02-23 21:34:12 +01:00
# Setup semver
COPY --from=builder /wheels /semver/wheels
RUN pip install --no-cache /semver/wheels/*
2019-08-06 21:23:51 +02:00
USER semver:semver
WORKDIR /workspace
ENTRYPOINT [ "semver" ]