The Wayback Machine - https://web.archive.org/web/20220218000628/https://github.com/Kong/kong/pull/8265
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

chore(*) support dev container #8265

Merged
merged 7 commits into from Jan 12, 2022
Merged

chore(*) support dev container #8265

merged 7 commits into from Jan 12, 2022

Conversation

@mayocream
Copy link
Member

@mayocream mayocream commented Jan 6, 2022

Summary

Add devcontainer.json to support Visual Studio Code Remote - Containers and GitHub Codespaces.

ref: https://code.visualstudio.com/docs/remote/containers

Tested locally.

To test: https://code.visualstudio.com/docs/remote/containers#_quick-start-try-a-development-container

@mayocream mayocream added the chore label Jan 6, 2022
@mayocream mayocream requested a review from kikito Jan 7, 2022
@mayocream mayocream requested a review from fffonion Jan 7, 2022
@mayocream
Copy link
Member Author

@mayocream mayocream commented Jan 7, 2022

Running well on my Mac M1 with VSCode containers. 🎉

Copy link
Contributor

@jschmid1 jschmid1 left a comment

tested - works.

Are the whitespace changes in the DEVELOPER.md file intended? If so this should maybe go into a separate PR(or commit)

@@ -0,0 +1,9 @@
FROM kong/kong:2.7.0
Copy link
Contributor

@jschmid1 jschmid1 Jan 11, 2022

Choose a reason for hiding this comment

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

since the purpose of the dev container is to work on the actual source, shouldn't we maybe use a plain alpine image to avoid conflicts?

Copy link
Member Author

@mayocream mayocream Jan 11, 2022

Choose a reason for hiding this comment

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

Using a plain alpine or ubuntu image spends more time compiling the dependencies.
We have the postCreateCommand option which will be executed in the initial phase of the new container, it will overwrite Kong's LuaRocks packages.

"postCreateCommand": "make dev",

Gojira also use this method as an option to start a dev environment: gojira up --image kong:2.7.0, see: https://github.com/Kong/gojira/blob/master/docs/manual.md#using-kong-release-images-with-gojira

Other popular projects like dapr also use an existing docker image to start:
https://github.com/dapr/dapr/blob/10784ac6e5886fb4242eac73c4f13a8962d17043/.devcontainer/devcontainer.json#L4

Copy link
Contributor

@jschmid1 jschmid1 Jan 11, 2022

Choose a reason for hiding this comment

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

ye, I saw that. I'm just mildly concerned that stray artifacts have an impact on the sources.

gojira, when used without the --image flag, it also uses a plain ubuntu image. https://github.com/Kong/gojira/blob/master/docker/Dockerfile#L1

Either way, if you don't think my concerns are valid, I'll remain silent and approve this PR :)

@mayocream
Copy link
Member Author

@mayocream mayocream commented Jan 11, 2022

tested - works.

Are the whitespace changes in the DEVELOPER.md file intended? If so this should maybe go into a separate PR(or commit)

Okay, the whitespace changes can be placed in a new PR.

bungle
bungle approved these changes Jan 11, 2022
@mayocream mayocream merged commit 34fc11c into master Jan 12, 2022
22 of 26 checks passed
@mayocream mayocream deleted the chore/devcontainer branch Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment