mirror of
https://github.com/schollz/hostyoself.git
synced 2026-07-17 16:39:00 +00:00
add Dockerfile
This commit is contained in:
parent
e96dfb99e7
commit
d34a5bca3f
1 changed files with 20 additions and 0 deletions
20
Dockerfile
Normal file
20
Dockerfile
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
###################################
|
||||
# 1. Build in a Go-based image #
|
||||
###################################
|
||||
FROM golang:1.12-alpine as builder
|
||||
RUN apk add --no-cache git ca-certificates # add deps here (like make) if needed
|
||||
WORKDIR /go/hostyoself
|
||||
COPY . .
|
||||
# any pre-requisities to building should be added here
|
||||
# RUN go generate
|
||||
RUN go build -v
|
||||
|
||||
###################################
|
||||
# 2. Copy into a clean image #
|
||||
###################################
|
||||
FROM alpine:latest
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=builder /go/hostyoself/hostyoself /hostyoself
|
||||
VOLUME /data
|
||||
CMD ["sh","-c","/hostyoself host --folder /data"]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue