mirror of
https://github.com/yeasy/docker_practice.git
synced 2024-11-23 23:13:39 +00:00
Update README.md
we need 'go mod init first' before 'go get'
This commit is contained in:
parent
7ec5772432
commit
09de77b543
@ -35,7 +35,8 @@ WORKDIR /go/src/github.com/go/helloworld/
|
||||
|
||||
COPY app.go .
|
||||
|
||||
RUN go get -d -v github.com/go-sql-driver/mysql \
|
||||
RUN go mod init helloworld \
|
||||
&& go get -d -v github.com/go-sql-driver/mysql \
|
||||
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . \
|
||||
&& cp /go/src/github.com/go/helloworld/app /root
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user