tstor/Dockerfile
Antonio Navarro Perez 1f2f1e025c Use 1.20 go alpine docker image
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2023-09-05 20:02:30 +02:00

33 lines
632 B
Docker

#===============
# Stage 1: Build
#===============
FROM golang:1.20-alpine as builder
ENV BIN_REPO=github.com/distribyted/distribyted
ENV BIN_PATH=$GOPATH/src/$BIN_REPO
COPY . $BIN_PATH
WORKDIR $BIN_PATH
RUN apk add fuse-dev git gcc libc-dev g++ make
RUN BIN_OUTPUT=/bin/distribyted make build
#===============
# Stage 2: Run
#===============
FROM alpine:3
RUN apk add gcc libc-dev fuse-dev
COPY --from=builder /bin/distribyted /bin/distribyted
RUN chmod +x /bin/distribyted
RUN mkdir /distribyted-data
RUN echo "user_allow_other" >> /etc/fuse.conf
ENV DISTRIBYTED_FUSE_ALLOW_OTHER=true
ENTRYPOINT ["./bin/distribyted"]