Skip to content

Commit

Permalink
suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalaiselvi84 committed Aug 14, 2023
1 parent ae92696 commit 43456ff
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions examples/simple-game-server/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,28 @@
# Build Stage
ARG WINDOWS_VERSION=ltsc2019

# create a Base Image from Golang, This sets up a build stage named "base" using a specific version of the Golang image.
# The platform is specified as Linux on AMD64 architecture
FROM --platform=linux/amd64 golang:1.20.4 as base
WORKDIR /go/src
COPY . agones.dev/agones

WORKDIR /gopath/src
COPY . /gopath/src/
RUN dir
WORKDIR /go/src/agones.dev/agones/examples/simple-game-server

RUN GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o bin/simple-game-server.exe main.go
RUN ls -ltr

RUN GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o simple-game-server.exe main.go

FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION}
WORKDIR /
RUN dir
RUN pwd

RUN ls -ltr

COPY --from=base /gopath/src/agones.dev/agones/bin/simple-game-server.exe /server
COPY --from=base /go/src/agones.dev/agones/simple-game-server.exe /server

EXPOSE 7654
USER ContainerUser

ENTRYPOINT ["C:\\server\\simple-game-server.exe"]

0 comments on commit 43456ff

Please sign in to comment.