-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.server
33 lines (22 loc) · 1.2 KB
/
Dockerfile.server
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
FROM ubuntu:jammy as builder
ARG PIP_INDEX_URL
ARG PIP_TRUSTED_HOST
ENV PIP_INDEX_URL=${PIP_INDEX_URL}
ENV PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST}
# TODO: use piwheels for armv7l specifically until/if ever mainline wheels available.
RUN if [ "$(uname -m)" = "armv7l" ] ; then echo "using piwheels" ; /bin/echo -e "[global]\nextra-index-url=https://www.piwheels.org/simple\n" > /etc/pip.conf ; fi
COPY . /faucetconfrpc
WORKDIR /faucetconfrpc
RUN apt-get update && apt-get install -y curl python3-dev gcc git g++ libc6-dev libyaml-dev libffi-dev libxml2-dev libxslt-dev make python3-pip libssl-dev openssl pkg-config
RUN pip install -U pip
RUN --mount=type=tmpfs,target=/root/.cargo /bin/bash -c 'curl https://sh.rustup.rs -sSf | bash -s -- -y && source ~/.cargo/env && MAKEFLAGS="-j $(nproc)" pip install . -v'
FROM ubuntu:jammy
COPY --from=builder /usr/local /usr/local
RUN apt-get update && apt-get install -y python3 iproute2 libatomic1
RUN python3 -c "from faucetconfrpc.faucetconfrpc_client_lib import FaucetConfRpcClient"
RUN faucetconfrpc_client --help
RUN faucetconfrpc_server --help
RUN ss --help
EXPOSE 59999
ENTRYPOINT ["faucetconfrpc_server"]
HEALTHCHECK --interval=30s CMD ss -tln|grep -q 59999 || exit 1