diff options
| author | EuAndreh <eu@euandre.org> | 2024-08-14 17:30:56 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2024-08-14 17:30:56 -0300 |
| commit | d9fa98494c83c42cad978b0b1000c35524b8026b (patch) | |
| tree | 810f83870cb349bf66b742a3875e4efcb4de3d4a /_example/simple/Dockerfile | |
| parent | Remove unused files (diff) | |
| download | golite-d9fa98494c83c42cad978b0b1000c35524b8026b.tar.gz golite-d9fa98494c83c42cad978b0b1000c35524b8026b.tar.xz | |
Remove most files from _example/
Diffstat (limited to '_example/simple/Dockerfile')
| -rw-r--r-- | _example/simple/Dockerfile | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/_example/simple/Dockerfile b/_example/simple/Dockerfile deleted file mode 100644 index 8ed0473..0000000 --- a/_example/simple/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -# ============================================================================= -# Multi-stage Dockerfile Example -# ============================================================================= -# This is a simple Dockerfile that will build an image of scratch-base image. -# Usage: -# docker build -t simple:local . && docker run --rm simple:local -# ============================================================================= - -# ----------------------------------------------------------------------------- -# Build Stage -# ----------------------------------------------------------------------------- -FROM golang:alpine3.18 AS build - -# Important: -# Because this is a CGO enabled package, you are required to set it as 1. -ENV CGO_ENABLED=1 - -RUN apk add --no-cache \ - # Important: required for go-sqlite3 - gcc \ - # Required for Alpine - musl-dev - -WORKDIR /workspace - -COPY . /workspace/ - -RUN \ - cd _example/simple && \ - go mod init github.com/mattn/sample && \ - go mod edit -replace=github.com/mattn/go-sqlite3=../.. && \ - go mod tidy && \ - go install -ldflags='-s -w -extldflags "-static"' ./simple.go - -RUN \ - # Smoke test - set -o pipefail; \ - /go/bin/simple | grep 99\ こんにちは世界099 - -# ----------------------------------------------------------------------------- -# Main Stage -# ----------------------------------------------------------------------------- -FROM scratch - -COPY --from=build /go/bin/simple /usr/local/bin/simple - -ENTRYPOINT [ "/usr/local/bin/simple" ] |
