Add Dockerfile to support building and running the XBlock workbench via a Docker container#108
Conversation
|
@nedbat ? |
|
bump @nedbat |
|
|
||
| $ docker run -d -p 8000:8000 --name xblock-sdk xblock-sdk | ||
|
|
||
| You should now be able to access the XBlock SDK environment in your browser at http://localhost:8000 |
There was a problem hiding this comment.
I'm a Docker newb. Will it be apparent how to edit source files and start new XBlock projects in the Docker image (if that's even the right place/word)? Should these instructions help the docker newb more?
There was a problem hiding this comment.
As written, this dockerfile won't be easy to get a locally-developed xblock into. Since that's the point of the XBlock-SDK, we should try and optimize for that usecase
|
@cpennington as someone who knows both XBlock and Docker, care to chime in? |
|
@nedbat the procedure is that you edit the files locally then run the docker commands 'build' and 'run' to deploy those local changes and run them. I didn't document the full workflow here, but I would do so in the tutorial. I spoke to @feanil and it sounded like this is the same workflow we are using for IDAs, but I could be wrong and have lost something in describing this to him. |
|
My thought was that this should hew as closely to OEP-5 as makes sense. In particular, it recommends that the docker image should mount the directory under development, so that the process running inside docker can auto-restart on changes. For the XBlock-SDK, it probably makes sense to mount another user-configurable directory that can have XBlocks in it, so that they can be pip-installed and thus used in the SDK (and it might make sense for the virtualenv to be placed into that directory, so that it's preserved across docker runs). |
|
To summarize our conversation in #xblocks on Slack, the Dockerfile here in the xblock-sdk will provide a base image without a mounted directory, and the cookiecutter-xblock repository (https://github.com/edx/cookiecutter-xblock) will generate a Dockerfile that allows a directory to be mounted for live editing. |
|
I've addressed the above here: edx/cookiecutter-xblock#1 @cpennington @nedbat would love to push these both ahead |
Uses https://github.com/phusion/baseimage-docker as a minimal Ubuntu base image to make the container as slim as possible.
Added instructions to the README.
Using this in conjunction with https://github.com/jbarciauskas/cookiecutter-xblock makes creating a new XBlock and testing it in the workbench very quick.