반응형

Dockerfile

FROM golang:alpine AS builder
ENV GO111MODULE=on \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64

WORKDIR /build
COPY go.mod go.sum main.go ./
COPY Conf_Linux.json ./Conf.json
COPY dao ./dao
COPY model ./model
RUN go mod download
RUN go mod tidy
RUN go build -o main .
WORKDIR /dist
RUN cp /build/main .

FROM scratch
COPY --from=builder /dist/main .
ENTRYPOINT ["/main"]

docker no cache build

docker build --no-cache -t aru_collector .

docker root 그룹 추가 및 적용

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

+ Recent posts