Testing Docker Publish scripts
If using the Makefile to make the binary and push to docker-hub can use a very simple Dockerfile like:
FROM alpine:latest
EXPOSE 8081
ADD ./bin/docker-test /opt/
ENTRYPOINT ["/opt/docker-test"]
This will not work with Dockerhub automated builds though.
FROM golang:alpine as builder
RUN mkdir /build
ADD . /build/
WORKDIR /build
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o main .
FROM scratch
COPY --from=builder /build/main /opt/
WORKDIR /opt
CMD ["./main"]
Content type
Image
Digest
Size
33.4 MB
Last updated
over 6 years ago
docker pull jeff1010322/docker-test