init Dockerfile to run machine in container

This commit is contained in:
Pavel Sviderski
2024-11-25 19:49:59 +10:00
parent df25b0d098
commit 95175d10c5
2 changed files with 24 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
# Ignore everything and use an allowlist of what is allowed to not package any secrets by accident.
*
# Allow files and directories.
!cmd/
!internal/
!go.*
# Ignore unnecessary files inside allowed directories.
**/.DS_Store
+14
View File
@@ -0,0 +1,14 @@
FROM golang:1.23.2-alpine AS uncloudd
ARG TARGETOS
ARG TARGETARCH
COPY . .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o uncloudd cmd/uncloudd/main.go
FROM docker:27.3.1-dind
RUN apk --no-cache add \
wireguard-tools
COPY --from=uncloudd /go/uncloudd /usr/local/bin/uncloudd
CMD ["uncloudd"]