Skip to content

[go-server] Add dockerfile for building and run petstore service#274

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
etherealjoy:go-server_add_dockerfile
Jun 13, 2018
Merged

[go-server] Add dockerfile for building and run petstore service#274
wing328 merged 4 commits into
OpenAPITools:masterfrom
etherealjoy:go-server_add_dockerfile

Conversation

@etherealjoy

Copy link
Copy Markdown
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

This PR aims to introduce a docker file to build and host the go server generated code inside a container.
Requests can be directed to container using API calls from a client.

  • Tested using curl on Linux

@antihax @wing328

@etherealjoy etherealjoy changed the title [go-server] Add dockerfile for building and run [go-server] Add dockerfile for building and run petstore service Jun 10, 2018
@wing328

wing328 commented Jun 12, 2018

Copy link
Copy Markdown
Member

cc @bvwells as well


Once image is built use
```
docker run --rm -it petstore

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etherealjoy should petstore be replaced by {{{packageName}}} instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, I have updated the commit.

@wing328

wing328 commented Jun 13, 2018

Copy link
Copy Markdown
Member

Tested locally and the result is good: (partial result)

Removing intermediate container 1cde8effa6b7
 ---> 3850dc3daa87
Step 11/11 : ENTRYPOINT ["./petstoreserver"]
 ---> Running in 04dc9f79b86d
Removing intermediate container 04dc9f79b86d
 ---> 0cca2b780ae2
Successfully built 0cca2b780ae2
Successfully tagged petstoreserver:latest
➜  go-api-server git:(etherealjoy-go-server_add_dockerfile) ✗ docker run --rm -it petstoreserver 
2018/06/13 08:53:57 Server started

@wing328 wing328 merged commit 2995273 into OpenAPITools:master Jun 13, 2018
@etherealjoy etherealjoy deleted the go-server_add_dockerfile branch June 13, 2018 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants