mirror of
https://github.com/SrIzan10/starters.git
synced 2026-05-01 11:05:16 +00:00
greatly simplify Dockerfile
This commit is contained in:
@@ -1,27 +1,13 @@
|
||||
FROM golang:1.16.2-alpine3.13 as builder
|
||||
WORKDIR /app
|
||||
COPY . ./
|
||||
# This is where one could build the application code as well.
|
||||
|
||||
|
||||
FROM alpine:latest as tailscale
|
||||
WORKDIR /app
|
||||
COPY . ./
|
||||
ENV TSFILE=tailscale_1.20.4_amd64.tgz
|
||||
RUN wget https://pkgs.tailscale.com/stable/${TSFILE} && \
|
||||
tar xzf ${TSFILE} --strip-components=1
|
||||
COPY . ./
|
||||
|
||||
|
||||
FROM alpine:latest
|
||||
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
|
||||
|
||||
# Copy binary to production image
|
||||
COPY --from=builder /app/start.sh /app/start.sh
|
||||
COPY --from=tailscale /app/tailscaled /app/tailscaled
|
||||
COPY --from=tailscale /app/tailscale /app/tailscale
|
||||
RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale
|
||||
RUN apk update \
|
||||
&& apk add curl openrc \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
RUN curl -fsSL https://tailscale.com/install.sh | sh
|
||||
|
||||
COPY . .
|
||||
|
||||
# Run on container startup.
|
||||
RUN chmod +x /app/start.sh
|
||||
CMD ["/app/start.sh"]
|
||||
CMD ["/app/start.sh"]
|
||||
|
||||
Reference in New Issue
Block a user