############################ # STEP 1 build executable binary ############################ FROM golang:alpine AS builder # Install git. # Git is required for fetching the dependencies. RUN apk update && \ apk add --no-cache ca-certificates pkgconf git libxml2-dev oniguruma-dev && \ apk add --virtual build-dependencies build-base gcc wget git && \ mkdir -p /opt/build WORKDIR /opt/build COPY . . # Fetch dependencies. # Using go get. RUN go get -d -v # Build the binary. RUN go build -o /go/bin/fbBot . ############################ # STEP 2 build a small image ############################ FROM alpine VOLUME /opt/tmp RUN apk update && \ apk add --no-cache ca-certificates chromium chromium-chromedriver inotify-tools inotify-tools-dev # Copy our static executable. COPY --from=builder /go/bin/fbBot /opt/fbBot COPY contrib/ / COPY config.yaml /etc/fbBot/config.yaml # Run the hello binary. ENTRYPOINT ["/opt/fbBot"]