Go/docker/Dockerfile
Bo-Yi Wu f171daa81a
feat: implement example-go service with Docker support
- 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>
2024-02-20 09:51:50 +08:00

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"]