Skip to content

Commit 8e10f95

Browse files
added Dockerfile to build a Go web API
1 parent 9f998ba commit 8e10f95

5 files changed

Lines changed: 18 additions & 0 deletions

File tree

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:latest
2+
3+
WORKDIR /build
4+
5+
COPY ./main /build
6+
7+
EXPOSE 8080
8+
9+
RUN go build -o main .
10+
11+
ENTRYPOINT [ "./main" ]

instructions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Run the following commands:
2+
3+
1. docker build -t golangwebapi .
4+
2. docker run -tid golangwebapi -p 8080:8080

main/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module main
2+
3+
go 1.14

main/main

7.03 MB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)