-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
68 lines (61 loc) · 2.04 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu:23.04 as build-env
ENV DEBIAN_FRONTEND=noninteractive
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TESTS
ARG SOURCE_COMMIT
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN echo "I am running on ${BUILDPLATFORM}, building for ${TARGETPLATFORM}"
# Prepare whl build env
RUN mkdir -p /usr/local/build
# Build FIX CA
COPY bootstrap /usr/local/sbin/bootstrap
COPY . /usr/src/fixca
RUN apt-get update
RUN apt-get -y install apt-utils
RUN apt-get -y dist-upgrade
RUN apt-get -y install \
openssl \
ca-certificates \
python3 \
python3-pip \
python3-setuptools \
python3-build \
python3-wheel
WORKDIR /usr/src/fixca
RUN pip wheel --wheel-dir=/usr/local/build --no-cache-dir .
RUN echo "${SOURCE_COMMIT:-unknown}" > /usr/local/etc/git-commit.HEAD
# Setup main image
FROM ubuntu:23.04
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG="en_US.UTF-8"
ENV TERM="xterm-256color"
ENV COLORTERM="truecolor"
ENV EDITOR="vi"
COPY --from=build-env /usr/local /usr/local
ENV PATH=/usr/local/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WORKDIR /
RUN groupadd -g "${PGID:-0}" -o fix \
&& useradd -g "${PGID:-0}" -u "${PUID:-0}" -o --create-home fix \
&& apt-get update \
&& apt-get -y --no-install-recommends install apt-utils \
&& apt-get -y dist-upgrade \
&& apt-get -y --no-install-recommends install \
dumb-init \
iproute2 \
dateutils \
openssl \
ca-certificates \
locales \
python3-minimal \
python3-pip \
&& ln -s /usr/bin/busybox /usr/local/bin/vi \
&& ln -s /usr/bin/busybox /usr/local/bin/less \
&& echo 'LANG="en_US.UTF-8"' > /etc/default/locale \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen \
&& pip install --no-cache-dir --break-system-packages /usr/local/build/*.whl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/local/build
ENTRYPOINT ["/bin/dumb-init", "--", "/usr/local/sbin/bootstrap"]
CMD ["/usr/local/bin/fixca"]