We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4ebe16 commit fc843bcCopy full SHA for fc843bc
1 file changed
go/samples/http/Dockerfile
@@ -1,25 +1,16 @@
1
-# Build Stage
2
# First pull Golang image
3
-FROM golang:1.19-alpine as build-env
+FROM golang:1.19-alpine
4
5
ENV APP_NAME sqlcommenter-http
6
-ENV CMD_PATH main.go
7
-
8
-# Copy application data into image
9
-COPY . $GOPATH/src/$APP_NAME
+
+# Set workdir
10
WORKDIR $GOPATH/src/$APP_NAME
+# Copy application data into image
+COPY . .
11
12
# Budild application
13
-RUN CGO_ENABLED=0 go build -v -o /$APP_NAME $GOPATH/src/$APP_NAME/$CMD_PATH
14
15
-# Run Stage
16
-FROM alpine:3.16.3
17
18
-# Set environment variable
19
-ENV APP_NAME sqlcommenter-http
20
21
-# Copy only required data into this image
22
-COPY --from=build-env /$APP_NAME .
+RUN CGO_ENABLED=0 go build -v
23
24
# Expose application port
25
EXPOSE 8081
0 commit comments