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

Add documentation on using the docker adapter manually #248

Open
mih opened this issue Oct 10, 2023 · 1 comment
Open

Add documentation on using the docker adapter manually #248

mih opened this issue Oct 10, 2023 · 1 comment

Comments

@mih
Copy link
Member

mih commented Oct 10, 2023

Scenario: I have a local Dockerfile, I built a local Docker image, I use it locally.

Now I want to preserve this image, I do not care about Docker hub and getting accounts and rate limits and payments and plan. I just have that local Docker image, and I want to use it in a datalad dataset via datalad containers-run.

@mih
Copy link
Member Author

mih commented Oct 11, 2023

I want the setup described in #197, so I use

❯ cat container/image/.gitattributes
**/*json annex.largefiles=nothing
repositories annex.largefiles=nothing
**/VERSION annex.largefiles=nothing
# build the image and track with datalad
datalad run -m "Build docker image with analysis environment" -i container/Dockerfile -o container/image sh -c "rm -rf container/image; docker build -t remodnav:latest container && python -m datalad_container.adapters.docker save remodnav:latest container/image && echo '**/*json annex.largefiles=nothing\nrepositories annex.largefiles=nothing\n**/VERSION annex.largefiles=nothing' > container/image/.gitattributes"

# register with datalad-container
$ datalad containers-add \
  -i container/image 
  --call-fmt '{python} -m datalad_container.adapters.docker run {img} {cmd}' \
  docker

In my specific case, I want something custom in the docker run setup, but something like this is not possible ATM

--call-fmt '{python} -m datalad_container.adapters.docker run -e HOME=/tmp {img} {cmd}'

I would want to declare options to docker run, maybe like the above, but this is not supported ATM.

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

1 participant