mirror of
https://gitea.com/action-examples/Go.git
synced 2026-03-27 08:30:06 +00:00
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>
This commit is contained in:
21
docker/Dockerfile
Normal file
21
docker/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
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"]
|
||||
Reference in New Issue
Block a user