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

feat: add devcontainer support #334

Merged
merged 7 commits into from
Oct 24, 2019
Merged

feat: add devcontainer support #334

merged 7 commits into from
Oct 24, 2019

Conversation

johnnyreilly
Copy link
Member

I use a Windows machine; the test pack for the fork-ts-checker-webpack-plugin has never entirely worked with Windows. This is fine; I just switch to WSL and go with it.

This PR adds in support for VS Code's dev containers; see: https://code.visualstudio.com/docs/remote/containers#_getting-started

This helps me and may help other Windows users that would like to contribute.

@phryneas
Copy link
Contributor

phryneas commented Sep 2, 2019

When started from linux, this seems to have permission problems - vscode tries to create files in /root, but it runs as user "node", so it doesn't have correct permissions to write there.

Run: docker exec 95209b7c27b90a0623404756729da4953c6ef6c63aedeba1399829ba49629277 test -d /root/.vscode-server/bin/c7d83e57cd18f18026a8162d042843bda1bcf21f
Installing VS Code Server for commit c7d83e57cd18f18026a8162d042843bda1bcf21f
Run: docker exec 95209b7c27b90a0623404756729da4953c6ef6c63aedeba1399829ba49629277 mkdir -p /root/.vscode-server/bin/c7d83e57cd18f18026a8162d042843bda1bcf21f_1567458922703
mkdir: cannot create directory '/root': Permission denied
Command failed: docker exec 95209b7c27b90a0623404756729da4953c6ef6c63aedeba1399829ba49629277 mkdir -p /root/.vscode-server/bin/c7d83e57cd18f18026a8162d042843bda1bcf21f_1567458922703

Adding a && chmod o-rwX /root \ somewhere in the Dockerfile seems to work, but that's more of a dirty workaround.
Unfortunately, I haven't tried devcontainers yet, so I don't really have experience with that. But I guess this is a common problem with all devcontainers based on the node container, so we can't be the first with that problem.

@johnnyreilly
Copy link
Member Author

That's interesting - I pretty much lifted and shifted the Microsoft example. I think it may have been this one: https://github.com/microsoft/vscode-dev-containers/tree/master/containers/javascript-node-lts-mongo/.devcontainer

Let me double check if I made any significant tweaks...

@johnnyreilly
Copy link
Member Author

johnnyreilly commented Sep 7, 2019

Unfortunately my first steps into Linux land have resulted in a bricked laptop 😄

@ob6160 and I will reattempt in a month or so; just need to fit a new hard drive and we've a hackathon to prepare for first.

When I'm up and running with Ubuntu I'll take this for a whirl there. Works great on Windows already though 😁

@ob6160
Copy link

ob6160 commented Sep 8, 2019

When I get a moment I'll give this a go on my Linux machine & look into a fix

@phryneas
Copy link
Contributor

phryneas commented Sep 8, 2019

Unfortunately my first steps into Linux land have resulted in a bricked laptop smile

What did you DO? :D

@johnnyreilly
Copy link
Member Author

@ob6160 only do it if you're totally bored - this can wait! (And it's not your fault I'm blocked; it's my dodgy machine 😄)

What did you DO? :D

Well my XPS had been behaving oddly for a while. It was that that prompted me to get a new one. When @ob6160 and I started attempting to repave the old one with Ubuntu we discovered that the hard drive was trashed midway through reformatting it. C'est la vie 😁

I now have a new hard drive which we'll use to resurrect the machine next month. I'll get there... It's just a matter of time ⌚

@ob6160
Copy link

ob6160 commented Sep 16, 2019

@phryneas this patch seems to do the trick on my linux box https://gist.github.com/ob6160/525eb3c6684e5d7104e676c410495a70

Maybe give a rebuild of your devcontainer a go with that change? Not sure why the runArgs didn't work though.

@johnnyreilly
Copy link
Member Author

I've patched - is that right @ob6160 ?

@johnnyreilly
Copy link
Member Author

I think this is now working thanks to @ob6160 help ❤️

I want to get a release out there as I've realised that @pelotom's #345 didn't trigger a release due to the commit format. I'm planning to merge this as (AFAIK) it all works and it should be a non-invasive change. There's nothing in here that can break existing users and it's certainly making it easier for me to work on the plugin 😄

Unless anyone objects I'm going to merge this PR when the CI goes green later this morning. This will trigger a release and fix the current live issue that exists with 1.5.1 - see @johnbouma's issue here: #349

@johnnyreilly johnnyreilly merged commit 9c37ebc into master Oct 24, 2019
@johnnyreilly johnnyreilly deleted the feature/devcontainer branch October 24, 2019 04:29
@johnnyreilly
Copy link
Member Author

Hopefully this should trigger a release shortly. Travis has been a little flaky for the last couple of days though - so will keep an eye on it

@piotr-oles
Copy link
Collaborator

🎉 This PR is included in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants