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

Documentation: setup with VS Code #13589

Closed
3 of 6 tasks
fulldecent opened this issue Mar 22, 2022 · 21 comments
Closed
3 of 6 tasks

Documentation: setup with VS Code #13589

fulldecent opened this issue Mar 22, 2022 · 21 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@fulldecent
Copy link
Contributor

fulldecent commented Mar 22, 2022

I am requesting please that a complete setup guide for podman with VS Code be added and maintained as part of our official documentation. Just like this but substituting Docker for podman: https://code.visualstudio.com/docs/remote/create-dev-container

Why

VS Code is a major use case, they have excellent support for containers and their support is viral. When you open a git repo configured for containers, VS Code encourages you to set up containers.

By default they recommend Docker and have one-click install. They also support podman but it is not as easy and when something goes wrong people are very likely to give up.

Most people I see considering podman in this scenario are doing so because they do not want to install a daemon or grant root access (running random repositories you download from the internet is dangerous, especially this week when millions of random projects unwittingly include a rm -rf in the install process as part of a Russia protest), or don't like Docker Desktop licensing.

An official support document is a large opportunity to grow adoption of podman.

How

Part 1—make it work

  • Identify a popular devops scenario that podman can make 10× better. ✅ DONE, GitHub pages is such a scenario.
  • Implement a .devcontainer for this devops scenario. ✅ DONE, implemented at https://github.com/fulldecent/blog.phor.net/tree/main/.devcontainer
  • Confirm it works locally in VS Code with Docker Desktop on macOS/M1 and on the web with GitHub Codespaces. ✅ DONE, testing successful
  • Figure out how to install podman and configure podman in VS Code so that it works the way it is currently ^^ working with Docker Desktop

Part 2—document it

  1. Buy a new MacBook.
  2. Install VS Code.
  3. Do not install Xcode tools or ANYTHING else.
  4. Begin documenting every step now.
  5. Do things, make the fun project above run inside VS Code.
  6. End documenting, publish to podman website and feature prominently.

Follow on work

  • Repeat this process on latest Windows.
  • Repeat this process on latest Ubuntu.
@baude baude added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 22, 2022
@baude
Copy link
Member

baude commented Mar 22, 2022

@fulldecent thanks for the submission. We are actually in the process of writing that exact kind of thing! your request suggests we are on the right track! assigning to @jwhonce as the author

@fulldecent
Copy link
Contributor Author

Thank you very much.

I maintain several "this is how to start programming in X language" tutorial repositories. So if this works out to be smooth, I will really appreciate the opportunity to link to these documents and to containerize all these projects by default.

Docker wasn't doing it for me. So podman is the real opportunity here.

@TomSweeneyRedHat
Copy link
Member

@fulldecent, IDK if it's of use, but we have a video by Chris Short on our YouTube channel demoing how he does it. I know it doesn't take the place of a document, but it might be a stop-gap for you or others finding this issue: https://www.youtube.com/watch?v=FnBzu3X9AMs&t=2s

@fulldecent
Copy link
Contributor Author

Thank you. I have watched the video and it does not appear to have anything to do with podman integration. It seems like he is just using VS Code to SSH into another box. And he is running manual podman commands in the terminal on those boxes.

The possibilities for VS Code integration are much greater. You are able to open a repository, not know anything about podman, not have access to other servers, not have Go installed, and then suddenly you are compiling Go programs in a safe container.

@fulldecent
Copy link
Contributor Author

A great use case for Podman + VS code + GitHub will be for GitHub Pages repositories.

Here is one example GitHub Pages repository: https://github.com/fulldecent/blog.phor.net

GitHub Pages is hosted with Jekyll which can be difficult to install, especially on macOS. Also, this installation has been related some security issues in the past.

A simple podman, no-root install would be a blessing for this application and it allows people to run these websites locally without installing any tools other than podman and it will integrate beautifully with VS Code.

@fulldecent fulldecent changed the title Documentation: setup with VS Code Documentation: setup with VS Code [💰 BOUNTY: USD 200] Mar 30, 2022
@fulldecent
Copy link
Contributor Author

BOUNTY NOTICE:

Pacific Medical Training commits a USD 200 bounty to whoever can resolve this issue.

Terms:

  • Offer is effective for 60 days, through May 30th.
  • Output includes: creating the documentation for setting up podman+VS Code+Jekyll for https://github.com/fulldecent/blog.phor.net to build and run the GitHub Pages website locally, result must be accepted/published by the podman project.
  • Recipient must be allowed to receive payments from the United States (i.e. from PayPal).

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@fulldecent fulldecent changed the title Documentation: setup with VS Code [💰 BOUNTY: USD 200] Documentation: setup with VS Code [💰 BOUNTY: USD 400] Apr 30, 2022
@fulldecent
Copy link
Contributor Author

Now doubling the bounty to USD 400. Same deadline.

@baude
Copy link
Member

baude commented May 1, 2022

@fulldecent not interested in the money ... is there a docker version of this document?

@fulldecent
Copy link
Contributor Author

@baude Yes, there is lot's of progress here https://code.visualstudio.com/docs/remote/create-dev-container


My goal here is to get a better version of that (I know it's hard to compete with VS Code documentation!) sporting a very practical example (GitHub Pages) and using our favored container manager (Podman).

And I know I didn't share this goal above, but after we are done with this issue, then the goal is to replace VS Code's default from Docker to Podman.

@github-actions
Copy link

github-actions bot commented Jun 2, 2022

A friendly reminder that this issue had no activity for 30 days.

@github-actions
Copy link

github-actions bot commented Jul 3, 2022

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jul 7, 2022

@fulldecent @baude What is the state of this?

@baude
Copy link
Member

baude commented Jul 7, 2022

nothing from my side

@afro-coder
Copy link
Contributor

Hi, I found this in the vscode docs

https://code.visualstudio.com/remote/advancedcontainers/docker-options#_podman

There is a feature request in the other repo
Came across this
microsoft/vscode-remote-release#6759

Tried doing this
image

{
	"name": "Alpine",
	"build": {
		"dockerfile": "Dockerfile",
		// Update 'VARIANT' to pick an Alpine version: 3.13, 3.14, 3.15
		"args": { "VARIANT": "3.15" }
	},

	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],

	// Use 'postCreateCommand' to run commands after the container is created.
	// "postCreateCommand": "uname -a",

	// Replace when using a ptrace-based debugger like C++, Go, and Rust
	"runArgs": [
		// run container as current user
		"--userns=keep-id",
		// disable selinux isolation that breaks bind mounts
		"--security-opt=label=disable",
		// mount user home directory for things like git, ssh, and other configs
		"--volume=${env:HOME}:${env:HOME}",
		// ensure project directory is mounted incase it exists outside the home directory
		"--volume=${localWorkspaceFolder}:${localWorkspaceFolder}",
		// isolate the .vscode-server folder so you don't overwrite settings from remote ssh vscode
		//"--volume=${localWorkspaceFolder}/.cache/vscode-server:${env:HOME}/.vscode-server"
	  ],
	  "containerEnv": {
		// ensure users home directory is the same inside the container as it is outside
		"HOME": "${env:HOME}"
	  },

	// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
	"remoteUser": "vscode"
}

image

@fulldecent would this work?

Just wanted to know if the goal here is to create a new extension completely? Since the one that is currently working is closed source.

P.S Not interested in the money, a new job maybe lol.

@fulldecent fulldecent changed the title Documentation: setup with VS Code [💰 BOUNTY: USD 400] Documentation: setup with VS Code Jul 8, 2022
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

A friendly reminder that this issue had no activity for 30 days.

@fulldecent
Copy link
Contributor Author

Have made some progress here.

Updated the top issue and published a repo that works with Docker Desktop and GitHub Codespaces.

UPDATE AT #13589 (comment)

@rhatdan
Copy link
Member

rhatdan commented Aug 9, 2022

Please open a PR to add this document.

@fulldecent
Copy link
Contributor Author

@rhatdan PR started at #15254

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@Luap99
Copy link
Member

Luap99 commented Oct 30, 2024

@Luap99 Luap99 closed this as completed Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

7 participants