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

How to instantiate a docker container using an image name and tag #83

Open
amro-albaali-vention opened this issue Jun 20, 2023 · 2 comments

Comments

@amro-albaali-vention
Copy link

Is it possible to create a Docker container using a specific Docker image tag?

That is, given a Docker image MyImage with multiple tags Tag1, Tag2, etc. How can I run

Docker.container
.create({
   Image: MyImage,
   name: my_container,
   ...

I noticed there isn't a Tag key to pass to create. Furthermore, I tried using MyImage:Tag1 for the Image field, but that didn't seem to work.

Is there a work around for this issue?

@dustsucker
Copy link

I couldn't get it to work either, as you can see in https://github.com/AgustinCB/docker-api/blob/master/src/types/container.ts currently there doesn't seem to be a tag option but a ImageID option I don't know what it does currently I find this project very interesting maybe i will try and fix that.

@dustsucker
Copy link

I found a possible workaround, didn't test it though https://github.com/AgustinCB/docker-api/blob/master/examples/pull_and_check_image.js you would need to try it to be sure. Would be better if you could do it directly.

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

2 participants