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

Start container with port and volumes #32

Closed
GiorgioBelli opened this issue Jan 13, 2021 · 6 comments
Closed

Start container with port and volumes #32

GiorgioBelli opened this issue Jan 13, 2021 · 6 comments

Comments

@GiorgioBelli
Copy link

Hi everyone,
I'm trying to use this useful library but can't figure out how to run an encrypted image with port mapping.
What is the equivalent of docker run -p <host_port>: <container_port> ...?
Also, I can't figure out how to specify volumes when starting the encrypted container.

thanks for your help.

@lumjjb
Copy link
Collaborator

lumjjb commented Jan 13, 2021

AFAIK, I don't think the docker CLI works with encrypted images yet, unless the transition to containerd backend has already been implemented.

@dmcgowan I remember there was a tracking issue for this, but can't find it, do you know if this is still in progress?

@GiorgioBelli
Copy link
Author

Thank you for replying,
sorry but i'm not looking for a way to run an encrypted image with docker. What i was asking is how to run an encrypted image with ctr-enc, specifing port mapping inside the command.
e.g. ctr-enc [args...] -p <host_port>:<container_port> ecrypted_image:tag container_name.

In docker there is the -p parameter but for this library what is the correct way to do this?

thank you again and sorry for misunderstanding.

@stefanberger
Copy link
Contributor

I am not sure whether this port mapping is actually possible on the level of containerd/ctr. Does ctr of containerd support this? From a look at ctr run --help it doesn't seem to be the case. ctr-enc is only an (old) derivative of ctr that we use for testing.

@AkihiroSuda
Copy link
Member

nerdctl (https://github.com/AkihiroSuda/nerdctl) provides the equivalent of docker run -p for containerd: nerdctl run -p.

Currently nerdctl does not support decryption, but probably it is quite easy to support decryption.

@AkihiroSuda
Copy link
Member

nerdctl now supports running ocicrypt containers with port and volumes: https://github.com/AkihiroSuda/nerdctl/blob/master/docs/ocicrypt.md

The CLI is same as Docker: nerdctl run -d --name foo -p 80:80 -v /data:/data example.com/some-ocicrypt-image

@GiorgioBelli
Copy link
Author

Thank you for the answer, i'll give a look. I think we can close this issue.

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

No branches or pull requests

4 participants