docker/ap-relay/Dockerfile.arm64v8

46 lines
858 B
Docker
Raw Normal View History

2020-03-16 23:44:12 +00:00
FROM asonix/diesel-cli:v1.4.0-r0-arm64v8 AS diesel
2020-03-16 19:54:47 +00:00
FROM arm64v8/rust:1.42.0-buster AS builder
# Set up git remote
ARG TAG
ARG GIT_REPOSITORY
ARG BUILD_DATE
RUN git clone -b ${TAG} ${GIT_REPOSITORY} /opt/relay
WORKDIR /opt/relay
RUN cargo install --path .
FROM arm64v8/ubuntu:19.10
2020-03-16 20:53:50 +00:00
ARG UID=991
ARG GID=991
2020-03-16 19:54:47 +00:00
RUN \
apt-get update && \
2020-03-16 23:44:12 +00:00
apt-get upgrade -y && \
apt-get install -y libpq5
2020-03-16 19:54:47 +00:00
RUN \
2020-03-16 23:44:12 +00:00
mkdir -p /opt/relay && \
2020-03-16 20:53:50 +00:00
addgroup --gid "${GID}" relay && \
2020-03-16 19:54:47 +00:00
adduser \
--disabled-password \
--gecos "" \
--ingroup relay \
2020-03-16 20:53:50 +00:00
--uid "${UID}" \
2020-03-16 19:54:47 +00:00
relay
2020-03-16 23:44:12 +00:00
COPY --from=diesel /usr/local/bin/diesel /usr/local/bin/diesel
2020-03-20 03:58:56 +00:00
COPY --from=builder /usr/local/cargo/bin/relay /usr/local/bin/relay
2020-03-16 23:44:12 +00:00
COPY --from=builder /opt/relay/migrations /opt/relay/migrations
RUN chown -R relay:relay /opt/relay
2020-03-16 19:54:47 +00:00
USER relay
2020-03-16 23:44:12 +00:00
WORKDIR /opt/relay
EXPOSE 8080
2020-03-16 19:54:47 +00:00
CMD ["relay"]