-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 872 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (23 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARG ALPINE_VERSION=latest
FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS alpine
ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
RUN apk update \
&& apk add -U --no-cache \
ca-certificates \
&& rm -rf /var/cache/apk/*
FROM golang:alpine AS builder
WORKDIR /src
COPY . /src
ENV GOCACHE=/gocache
RUN --mount=type=cache,target="/gocache" apk add --update --no-cache make git \
&& make cloudflare-warp
FROM alpine
LABEL org.opencontainers.image.source="https://github.com/shahradelahi/cloudflare-warp"
# Create and set permissions for the data directory
RUN mkdir -p /var/lib/cloudflare-warp
COPY docker/entrypoint.sh /entrypoint.sh
COPY --from=builder /src/build/warp /usr/bin/warp
RUN apk add --update --no-cache iptables iproute2 tzdata \
&& chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]