mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-12-23 04:05:39 +00:00
Merge pull request #221 from jcgruenhage/reduce-container-image-size
Reduce container image size
This commit is contained in:
commit
cc066d7aeb
@ -1,18 +1,22 @@
|
||||
FROM golang:stretch
|
||||
MAINTAINER Christer Waren/CWINFO "christer.waren@cwinfo.org"
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get upgrade -y
|
||||
|
||||
ADD . /src
|
||||
FROM docker.io/golang:alpine as builder
|
||||
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
RUN apk add git && ./build
|
||||
|
||||
RUN adduser --system --home /etc/yggdrasil-network --uid 1000 yggdrasil-network \
|
||||
&& rm -rf build_* && ./build \
|
||||
&& cp yggdrasil /usr/bin \
|
||||
&& cp contrib/docker/entrypoint.sh /
|
||||
FROM docker.io/alpine
|
||||
LABEL maintainer="Christer Waren/CWINFO <christer.waren@cwinfo.org>"
|
||||
|
||||
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" ]
|
||||
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user