FROM golang:alpine as builder ARG DRONE_COMMIT="none" ARG DRONE_TAG="none" RUN apk --no-cache add git WORKDIR /app COPY . . # ldflags to remove debugging tables ENV DRONE_COMMIT=$DRONE_COMMIT ENV DRONE_TAG=$DRONE_TAG RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s -X main.version=$DRONE_TAG -X main.commit=$DRONE_COMMIT" -o "mediaconverter" . RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s -X main.version=$DRONE_TAG -X main.commit=$DRONE_COMMIT" -o "faker" ./faker/ FROM alfg/ffmpeg USER 1000:1000 COPY --from=builder /app/mediaconverter /mediaconverter COPY --from=builder /app/faker /mediaconverter CMD ["/mediaconverter"]