- Add a new Makefile with build, docker-build, test, and clean targets, including cross-compilation support for Linux AMD64 and ARM64. - Introduce a new Go executable `example-go` with a basic HTTP server setup. - Create a new Dockerfile for an Alpine-based container including the `example-go` binary, with metadata labels and an entrypoint. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
22 lines
497 B
Docker
22 lines
497 B
Docker
FROM alpine:3.19
|
|
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
|
|
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
|
org.label-schema.name="api" \
|
|
org.label-schema.vendor="Bo-Yi Wu" \
|
|
org.label-schema.schema-version="1.0" \
|
|
com.centurylinklabs.watchtower.stop-signal="SIGINT" \
|
|
io.containers.autoupdate="registry"
|
|
|
|
RUN apk update && apk add --no-cache ca-certificates
|
|
|
|
EXPOSE 8080
|
|
|
|
ENV GODEBUG netdns=go
|
|
|
|
COPY release/${TARGETOS}/${TARGETARCH}/example-go /bin/example-go
|
|
|
|
ENTRYPOINT ["/bin/example-go"]
|