forked from ghostunnel/ghostunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-alpine
More file actions
30 lines (23 loc) · 846 Bytes
/
Dockerfile-alpine
File metadata and controls
30 lines (23 loc) · 846 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
# Dockerfile for ghostunnel/ghostunnel built on Alpine.
#
# To build this image:
# docker buildx build -t ghostunnel/ghostunnel .
#
# To run ghostunnel from the image (for example):
# docker run --rm ghostunnel/ghostunnel --version
FROM golang:alpine AS build
# Dependencies
RUN apk add --no-cache --update gcc musl-dev libtool git
# Copy source
COPY . /go/src/github.com/ghostunnel/ghostunnel
# Install mage and build
RUN cd /go/src/github.com/ghostunnel/ghostunnel && \
go install github.com/magefile/mage@latest && \
export PATH=$PATH:$(go env GOPATH)/bin && \
mage -v go:build && \
cp ghostunnel /usr/bin/ghostunnel
# Create a multi-stage build with the binary
FROM alpine
RUN apk add --no-cache --update libtool curl
COPY --from=build /usr/bin/ghostunnel /usr/bin/ghostunnel
ENTRYPOINT ["/usr/bin/ghostunnel"]