2020-11-14 15:28:50 +00:00
|
|
|
#===============
|
|
|
|
# Stage 1: Build
|
|
|
|
#===============
|
|
|
|
|
2023-10-13 08:03:02 +00:00
|
|
|
FROM golang:1.20 as builder
|
2020-11-14 15:28:50 +00:00
|
|
|
|
2023-10-08 16:46:03 +00:00
|
|
|
ENV BIN_REPO=git.kmsign.ru/royalcat/tstor
|
2020-11-14 15:28:50 +00:00
|
|
|
ENV BIN_PATH=$GOPATH/src/$BIN_REPO
|
|
|
|
|
|
|
|
COPY . $BIN_PATH
|
|
|
|
WORKDIR $BIN_PATH
|
|
|
|
|
|
|
|
RUN apk add fuse-dev git gcc libc-dev g++ make
|
|
|
|
|
2023-10-08 16:46:03 +00:00
|
|
|
RUN BIN_OUTPUT=/bin/tstor make build
|
2020-11-14 15:28:50 +00:00
|
|
|
|
|
|
|
#===============
|
|
|
|
# Stage 2: Run
|
|
|
|
#===============
|
|
|
|
|
|
|
|
FROM alpine:3
|
|
|
|
|
|
|
|
RUN apk add gcc libc-dev fuse-dev
|
|
|
|
|
2023-10-08 16:46:03 +00:00
|
|
|
COPY --from=builder /bin/tstor /bin/tstor
|
|
|
|
RUN chmod +x /bin/tstor
|
2020-11-14 15:28:50 +00:00
|
|
|
|
2023-10-08 16:46:03 +00:00
|
|
|
RUN mkdir /tstor-data
|
2020-11-14 15:28:50 +00:00
|
|
|
|
|
|
|
RUN echo "user_allow_other" >> /etc/fuse.conf
|
2023-10-08 16:46:03 +00:00
|
|
|
ENV tstor_FUSE_ALLOW_OTHER=true
|
2020-11-14 15:28:50 +00:00
|
|
|
|
2023-10-08 16:46:03 +00:00
|
|
|
ENTRYPOINT ["./bin/tstor"]
|