mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-27 12:05:23 +00:00
Reduce container image size
This commit is contained in:
parent
58b60af208
commit
9f4fc3669b
@ -1,18 +1,22 @@
|
|||||||
FROM golang:stretch
|
FROM docker.io/golang:alpine as builder
|
||||||
MAINTAINER Christer Waren/CWINFO "christer.waren@cwinfo.org"
|
|
||||||
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get upgrade -y
|
|
||||||
|
|
||||||
ADD . /src
|
|
||||||
|
|
||||||
|
COPY . /src
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
RUN apk add git && ./build
|
||||||
|
|
||||||
RUN adduser --system --home /etc/yggdrasil-network --uid 1000 yggdrasil-network \
|
FROM docker.io/alpine
|
||||||
&& rm -rf build_* && ./build \
|
LABEL maintainer="Christer Waren/CWINFO <christer.waren@cwinfo.org>"
|
||||||
&& cp yggdrasil /usr/bin \
|
|
||||||
&& cp contrib/docker/entrypoint.sh /
|
COPY --from=builder /src/yggdrasil /usr/bin/yggdrasil
|
||||||
|
COPY --from=builder /src/yggdrasilctl /usr/bin/yggdrasilctl
|
||||||
|
COPY contrib/docker/entrypoint.sh /usr/bin/entrypoint.sh
|
||||||
|
|
||||||
|
# RUN addgroup -g 1000 -S yggdrasil-network \
|
||||||
|
# && adduser -u 1000 -S -g 1000 --home /etc/yggdrasil-network yggdrasil-network
|
||||||
|
#
|
||||||
|
# USER yggdrasil-network
|
||||||
|
# TODO: Make running unprivileged work
|
||||||
|
|
||||||
VOLUME [ "/etc/yggdrasil-network" ]
|
VOLUME [ "/etc/yggdrasil-network" ]
|
||||||
|
|
||||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
|
||||||
|
2
contrib/docker/entrypoint.sh
Normal file → Executable file
2
contrib/docker/entrypoint.sh
Normal file → Executable file
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user