cs50/ide
CS50 IDE's Docker configuration for Cloud9
Since Docker containers are built incrementally, building an offline container
requires first creating an underlying workspace image, then building
an ide50 image on top of that, and then finally creating the
ide50-offline image on top. There are some make
commands to
simplify this process.
The primary way to make changes to the offline workspace is to add things (required packages, scripting various installation steps, etc) to the ide50 Debian package which is also used for the online version of the IDE. The build process below builds an offline IDE based on the publicly-accessible IDE50 package on mirror.cs50.net.
First build an offline workspace from scratch using the "To build all from scratch" steps below.
Next, make changes to the ide50 Debian package, build it, and follow the directions on that repo to locally install the deb on the offline workspace (also be sure to test it on an online workspace!) you generated above.
If all goes well, publish the deb to the mirror and build the offline workspace from scratch, once there has been sufficient time for all mirrors to receive the new deb.
cd /path/to/ide50-docker
.make build
and wait. This builds all images sequentially.make run
.make open
to automatically open a tab in your favorite
browser that loads the offline IDE.make stop
make clean
make offline
Rebuilding from an earlier version (say, if you need to build a new
ide50 container with a new version of the ide50 deb) will require
rebuilding from that container. It's probably easiest to delete all images
and then run make build
.
We generally deploy a new offline version when a new version of the ide50 deb is released. This way, people that download the offline version are sure to have the very latest.
docker ps -a
to see a full list of docker
containers, stopping any relevant ones if necessary, and remove them
with docker rm
. Use docker images
to see a list of images,
and use docker rmi
to delete those images. I usually delete all images
that are associated with the offline IDE to be sure to build from scratch.make build
to build from scratch.make run
to ensure the latest deb was installed
and all changes are as they appear.If all looks good after a successful complete build, begin the actual deployment steps:
make squash
to squash the
docker image into as small of a size as possible. Note: docker squash
tools tend to change rapidly, so you may need to update the squash
rule
in the Makefile periodically, or update the copy of the docker-squash.docker tag ide50-offline cs50/ide50-offline:beta
docker tag ide50-offline cs50/ide50-offline:latest
docker push cs50/ide50-offline:beta
docker push cs50/ide50-offline:latest
There are a variety of commands in make
to help re-build an image.
make build
Builds the wkspc
image, then the ide
image, then
the offline
image.make wkspc
, make ide
, and
make offline
, respectively.make run
runs an already-built offline containermake stop
then stops that running containermake open
(Mac OS X only, probably) opens the offline IDE in your browser.make shell
to open a shell in the running containermake clean
removes the offline image and container onlyAfter making changes to CSS (e.g., in /var/c9sdk/plugins/*
) or config files (e.g., /var/c9sdk/configs/ide/workspace-cs50.js
):
cd /path/to/ide50-docker
make shell
/var/c9sdk/scripts/install-sdk.sh
exit
make restart
docker-machine regenerate-certs default
If something still seems awry with Docker, odds are the below will help. The below will delete and recreate the virtual machine used by Docker.
docker-machine stop default
docker-machine rm default
docker-machine create --driver virtualbox default
eval $(docker-machine env default)