ReproNim / reproman

ReproMan (AKA NICEMAN, AKA ReproNim TRD3)
https://reproman.readthedocs.io
Other
24 stars 14 forks source link

docker container: Let user specify shell #482

Open kyleam opened 4 years ago

kyleam commented 4 years ago

The code assumes that /bin/bash is available:

https://github.com/ReproNim/reproman/blob/2e39954e444cf10cbbb0dccdb2e7728e35b65469/reproman/resource/docker_container.py#L165-L175

But there are of course plenty of images where this isn't the case:

$ reproman create bb -t docker-container -b image=busybox:latest
2019-11-05 15:03:05,531 [INFO   ] Pulling from library/busybox 
2019-11-05 15:03:05,798 [INFO   ] Digest: sha256:1303dbf110c57f3edf68d9f5a16c082ec06c4cf7604831669faf2c712260b5a0 
2019-11-05 15:03:05,799 [INFO   ] Status: Image is up to date for busybox:latest 
2019-11-05 15:03:06,571 [ERROR  ] 400 Client Error: Bad Request ("OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown") [errors.py:create_api_error_from_http_exception:31] (APIError)

$ reproman  create alp -t docker-container -b image=alpine:3.6   
2019-11-05 15:03:49,794 [INFO   ] Pulling from library/alpine 
2019-11-05 15:03:50,083 [INFO   ] Digest: sha256:66790a2b79e1ea3e1dabac43990c54aca5d1ddf268d9a5a0285e4167c8b24475 
2019-11-05 15:03:50,083 [INFO   ] Status: Image is up to date for alpine:3.6 
2019-11-05 15:03:50,782 [ERROR  ] 400 Client Error: Bad Request ("OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown") [errors.py:create_api_error_from_http_exception:31] (APIError)