Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jun 13, 2018

Conversation

etherealjoy
Copy link
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
Copy link
Member

wing328 commented Jun 12, 2018

cc @bvwells as well


Once image is built use
```
docker run --rm -it petstore
Copy link
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
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
Copy link
Member

wing328 commented Jun 13, 2018

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.

None yet

3 participants