Skip to content

Instantly share code, notes, and snippets.

@kaczmarj
Created January 11, 2019 16:28
Show Gist options
  • Save kaczmarj/34c24f92e3867b59d64ff25aa7222c8d to your computer and use it in GitHub Desktop.
Save kaczmarj/34c24f92e3867b59d64ff25aa7222c8d to your computer and use it in GitHub Desktop.
scripted neurodocker
import neurodocker
specs = {'pkg_manager': 'apt', 'instructions': [['base', 'debian'], ['install', ['git', 'vim']]]}
dockerfile_string = neurodocker.Dockerfile(specs).render()
print(dockerfile_string)
@kaczmarj
Copy link
Author

If you're confused about how the specs dictionary should look, you can generate a JSON representation of a neurodocker command with the --json flag.

$ docker run --rm kaczmarj/neurodocker:0.4.3 generate docker \
  --base=neurodebian:stretch --pkg-manager=apt \
  --install fsl \
  --spm12 version=r7219 \
  --json
{"pkg_manager": "apt", "instructions": [["base", "neurodebian:stretch"], ["install", ["fsl"]], ["spm12", {"version": "r7219"}]]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment