Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions guestbook-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.10.0
FROM golang:1.18 AS builder


WORKDIR /app


RUN go mod init temp-module || true
RUN go get github.com/codegangsta/negroni \
github.com/gorilla/mux \
github.com/xyproto/simpleredis/v2
WORKDIR /app
ADD ./main.go .


COPY ./main.go .


RUN CGO_ENABLED=0 GOOS=linux go build -o main .


FROM scratch
WORKDIR /app
COPY --from=0 /app/main .
COPY --from=builder /app/main .
COPY ./public/index.html public/index.html
COPY ./public/script.js public/script.js
COPY ./public/style.css public/style.css
Expand Down