Added build script and fixed some bugs

This commit is contained in:
ndouba
2022-11-15 22:32:24 -05:00
parent 8f19249c51
commit 9cc4b28a49
9 changed files with 317 additions and 12 deletions

17
Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM debian
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /go/src/github.com/allfro/device-volume-driver
COPY . .
RUN apt update && \
apt install -y musl-dev musl-tools git curl && \
curl -L -o go.tgz https://go.dev/dl/go1.19.3.linux-amd64.tar.gz && \
tar -zxvf go.tgz && \
export PATH=$PATH:go/bin && \
go get && \
CC=/usr/bin/musl-gcc go build -ldflags "-linkmode external -extldflags -static" -o /dvd
FROM alpine
COPY --from=0 /dvd /dvd
ENTRYPOINT ["/dvd"]