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

Equivalent command for docker context #12811

Closed
benatshippabo opened this issue Jan 11, 2022 · 27 comments
Closed

Equivalent command for docker context #12811

benatshippabo opened this issue Jan 11, 2022 · 27 comments
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. planning Accepted and planned for future release

Comments

@benatshippabo
Copy link

benatshippabo commented Jan 11, 2022

There does not seem to be an equivalent command in Podman for docker context. Various vscode extensions use this in some form such as the vscode Docker extension.

Originally posted by @mheon in #12745 (reply in thread)

@rhatdan
Copy link
Member

rhatdan commented Jan 11, 2022

@baude PTAL

@rhatdan
Copy link
Member

rhatdan commented Jan 11, 2022

@benatshippabo interested in working on it?

@mheon
Copy link
Member

mheon commented Jan 11, 2022

The full suite is documented at https://docs.docker.com/engine/reference/commandline/context/

They seem to be vaguely analogous to our podman system connection commands, but with additional features on top.

@jwhonce
Copy link
Member

jwhonce commented Jan 11, 2022

@mheon @baude

After a quick review, I think we should target this for 4.1+. If we do not implement the deprecated flags/fields then our system connection data appears to be subset of the context data. Implying no breaking changes required, just adding fields or aliases to fields, and commands.

This would also allow us to encapsulate the connection/context handling in a c/common package. Something the gvproxy author was also interested in having. /cc @ashley-cui @cdoern

Action Item:

  1. How are the context Storage fields used?
  2. --docker should be aliased to --podman flag

@jwhonce jwhonce added the planning Accepted and planned for future release label Jan 11, 2022
@rhatdan
Copy link
Member

rhatdan commented Jan 12, 2022

We could handle this like we do with podman buildx and attempt to hide the implementation. IE if a user has a script that executes it will work, but we don't document it.

I am not sure how complex it is.

@github-actions
Copy link

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

@rhatdan rhatdan added Good First Issue This issue would be a good issue for a first time contributor to undertake. and removed stale-issue labels Feb 14, 2022
@github-actions
Copy link

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

@rhatdan rhatdan self-assigned this Mar 22, 2022
@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Apr 22, 2022

@Luap99 Do you have time to take a stab at this? I think the main goal would be to allow vscode to work with it.

@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented May 24, 2022

@flouthoc Any time to work on this?

@rhatdan
Copy link
Member

rhatdan commented May 24, 2022

@cdoern Interested in this one?

@rhatdan rhatdan removed their assignment May 24, 2022
@ankanroy-code
Copy link

hello everyone i am trying to contribute into this project. I am new to go-lang so its taking time. i already create a command called context, using the README file in the cmd/podman . also create sub commands for it for it. I am just playing around with the source code, trying to understand how things work. Can anyone tell me what should i do next. Especially to solve this issue or another, that you think would be better. how can i contribute. I am currently fully free, so can spend good amount of time on the project.

@cdoern
Copy link
Collaborator

cdoern commented Jun 10, 2022

@ankanroy-code if you have created a podman context command please file a pull request with the code!

Otherwise, I can work on this issue over the coming weeks as it was initially planned for 4.1.x and we are approaching (kind of ) 4.2

@ankanroy-code
Copy link

@cdoern the command i created was a random command that i named context it has nothing to do with podman context I was just trying to understand the code base.

@rhatdan
Copy link
Member

rhatdan commented Jun 12, 2022

The basic idea is to implement the commands that docker context implements, but tie it into podman system connection.

$ docker context --help

Usage:  docker context COMMAND

Manage contexts

Commands:
  create      Create a context
  export      Export a context to a tar or kubeconfig file
  import      Import a context from a tar or zip file
  inspect     Display detailed information on one or more contexts
  ls          List contexts
  rm          Remove one or more contexts
  update      Update a context
  use         Set the current docker context

Run 'docker context COMMAND --help' for more information on a command.

$ podman system connection --help
Manage remote API service destinations

Description:
  Manage remote API service destination information in podman configuration

Usage:
  podman system connection [command]

Available Commands:
  add         Record destination for the Podman service
  default     Set named destination as default
  list        List destination for the Podman service(s)
  remove      Delete named destination
  rename      Rename "old" to "new"

docker context create -> podman system connection add
docker context use -> podman system connection default
docker context ls -> podman system connection list
docker context rm -> podman system connection remove

Would need to look at docker context inspect and see if we can do something similar with podman.

export, import, update would need to be examined to see if they apply to Podman, or should be just implemented as not supported.

@rhatdan
Copy link
Member

rhatdan commented Jun 12, 2022

I would also prefer that these be hidden for now, so they would work if someone scripted, but we don't need to advertise use of these.

@ankanroy-code
Copy link

hey i am trying to solve this issue, but could not for now. i asked this question on cobra GitHub issue, about how can i Alias
docker context create -> podman system connection add here. its seems we have to re implement a lot of the code from system connection

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2022

Looker for podman buildx.
./cmd/podman/images/buildx.go

This is linking podman buildx->podman build.

Bottom line to this is just to add the cobra calls and then have them call into the system connection functions.

@stweil
Copy link
Contributor

stweil commented Jun 18, 2022

ddev requires docker context inspect. Maybe more is missing to use ddev with podman, but that's the first problem.

@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Jul 21, 2022

@cdoern @ashley-cui @vrothberg @umohnani8 I thought we had an intern working on this? I think we should raise the priority if noone is working on it.

@cdoern
Copy link
Collaborator

cdoern commented Jul 21, 2022

@cdoern @ashley-cui @vrothberg @umohnani8 I thought we had an intern working on this? I think we should raise the priority if noone is working on it.

on the backlog document we were looking at last week I noticed that no one got assigned to this. I think there is a debate of how this is to be implemented. I should probably work on it since I am currently redesigning how podman system connection works.

@rhatdan rhatdan self-assigned this Aug 16, 2022
willwh added a commit to willwh/podman that referenced this issue Sep 16, 2022
@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Sep 19, 2022

A patch supporting podman context was just merged.

@chughts
Copy link

chughts commented Dec 20, 2022

is podman context supported as of podman 4.2 ?

https://podman.io/releases/2022/08/17/podman-release-v4.2.0.html

@rhatdan
Copy link
Member

rhatdan commented Dec 20, 2022

Nope looks like it is in 4.3.0
https://github.com/containers/podman/releases/tag/v4.3.0

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. planning Accepted and planned for future release
Projects
None yet
Development

No branches or pull requests

8 participants