From d8549db1ebe9f6edeac40ed2e7917133d4e82d98 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Tue, 4 Apr 2023 13:28:18 +0800 Subject: [PATCH] fix the dockerfile build process (#24) Co-authored-by: rick --- Dockerfile | 4 +--- sample/manifest.yaml | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 sample/manifest.yaml diff --git a/Dockerfile b/Dockerfile index d738dfa22..b71c1c5fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,7 @@ FROM golang:1.17 as builder WORKDIR /workspace COPY . . RUN go mod download -RUN CGO_ENABLE=0 go build -ldflags "-w -s" -o atest cmd/*.go - -FROM ghcr.io/linuxsuren/hd:v0.0.67 as hd +RUN CGO_ENABLE=0 go build -ldflags "-w -s" -o atest . FROM alpine:3.10 diff --git a/sample/manifest.yaml b/sample/manifest.yaml new file mode 100644 index 000000000..c72ad4709 --- /dev/null +++ b/sample/manifest.yaml @@ -0,0 +1,46 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + creationTimestamp: null + labels: + app: api-testing + name: api-testing +spec: + replicas: 1 + selector: + matchLabels: + app: api-testing + strategy: {} + template: + metadata: + creationTimestamp: null + labels: + app: api-testing + spec: + containers: + - image: ghcr.io/linuxsuren/api-testing + name: server + resources: + limits: + cpu: "1" + memory: 1Gi + requests: + cpu: "100m" + memory: 100m +status: {} +--- +apiVersion: v1 +kind: Service +metadata: + name: api-testing +spec: + ports: + - name: server + port: 9090 + protocol: TCP + targetPort: 9090 + selector: + app: api-testing + sessionAffinity: None + type: NodePort