Skip to content

Add Dockerfile to support building and running the XBlock workbench via a Docker container#108

Merged
jbarciauskas merged 3 commits intoopenedx:masterfrom
jbarciauskas:jbarciauskas/add-docker-support
Oct 12, 2016
Merged

Add Dockerfile to support building and running the XBlock workbench via a Docker container#108
jbarciauskas merged 3 commits intoopenedx:masterfrom
jbarciauskas:jbarciauskas/add-docker-support

Conversation

@jbarciauskas
Copy link
Copy Markdown
Contributor

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.

@jbarciauskas
Copy link
Copy Markdown
Contributor Author

@nedbat ?

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 86.686% when pulling ae88852 on jbarciauskas:jbarciauskas/add-docker-support into 4fa005a on edx:master.

@jbarciauskas
Copy link
Copy Markdown
Contributor Author

bump @nedbat

Comment thread README.rst

$ 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@nedbat
Copy link
Copy Markdown
Contributor

nedbat commented Aug 10, 2016

@cpennington as someone who knows both XBlock and Docker, care to chime in?

@jbarciauskas
Copy link
Copy Markdown
Contributor Author

@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.

@cpennington
Copy link
Copy Markdown
Contributor

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).

@jbarciauskas
Copy link
Copy Markdown
Contributor Author

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.

@jbarciauskas
Copy link
Copy Markdown
Contributor Author

I've addressed the above here: edx/cookiecutter-xblock#1

@cpennington @nedbat would love to push these both ahead

@jbarciauskas jbarciauskas merged commit 6a695d9 into openedx:master Oct 12, 2016
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

Successfully merging this pull request may close these issues.

4 participants