33 lines
728 B
Docker
33 lines
728 B
Docker
FROM alpine:3.14 as intermediate
|
|
|
|
RUN mkdir /src
|
|
WORKDIR /src
|
|
|
|
# Install the build tools
|
|
RUN apk add git go make
|
|
|
|
# Fetch the source
|
|
RUN git clone https://github.com/slackhq/nebula.git
|
|
|
|
# Compile the Linux binaries for all platforms
|
|
WORKDIR /src/nebula
|
|
RUN echo 'bin-linux: $(ALL_LINUX:%=build/%/nebula) $(ALL_LINUX:%=build/%/nebula-cert)' >> Makefile
|
|
RUN make bin-linux
|
|
|
|
# Start from a clean image
|
|
FROM alpine:3.14
|
|
|
|
RUN mkdir /app
|
|
WORKDIR /app
|
|
|
|
# Copy over the compiled binaries
|
|
COPY --from=intermediate /src/nebula/build ./
|
|
|
|
# Rename the directories from `go env` format to `uname` format
|
|
RUN mv linux-amd64 linux-x86_64
|
|
|
|
COPY docker-entrypoint.sh entrypoint.sh
|
|
|
|
EXPOSE 4242/udp
|
|
ENTRYPOINT [ "/bin/sh", "/app/entrypoint.sh" ]
|