- SSH into the docker machine.
- Take a snaphost of a container to have a backup copy:
docker commit -p [container-id] [backup-image-name]
- Make sure the site still works after taking the snapshot (in case pausing a container somehow breaks it)
- Launch a test site based on the backup image:
docker run -i -t -P -d [backup-image-name] /sbin/my_init --enable-insecure-key
and note its container ID ([test-site-container-id]
) - Start a bash session inside the container
docker exec -i -t [test-site-container-id] /bin/bash
- Update Open edX:
/edx/bin/update edx-platform [git commit/tag/branch]
- Make sure everything works:
/edx/bin/supervisorctl status
- sometimes the forum app goes down, in which case run
rm /edx/var/forum/forum.sock
, then/edx/bin/supervisorctl start forum
and then after a while make sure the forum is up and running:/edx/bin/supervisorctl status forum
- sometimes the forum app goes down, in which case run
- If you have to add new env vars for the Open edX site then:
- if they are not set on the container itself you can add them in
/etc/container_environment/
(https://github.com/phusion/baseimage-docker#centrally-defining-your-own-environment-variables) - if the variables are set on the container level then they can’t be overriden in
/etc/container_environment
. The workaround is to add them in/etc/service/supervisor/run
, right before the last command that starts supervisord. Add something likeexport VAR_NAME="some value"
for each variable you want to add and then restart the supervisor:sv restart supervisor
.
- if they are not set on the container itself you can add them in
- After updating the variables
exit
the container and restart it:docker restart [test-site-container-id]
. Note that docker changes the exposed ports so you have to refresh Hipache routes in the launcher’s admin (actually for a test site there is no route so this is mostly for updating production sites). - Ssh into the container (
docker inspect -f "{{ .NetworkSettings.IPAddress }}" <ID>
followed byssh -i ~/insecure_key root@<IP address>
) and typeenv
to make sure the env vars are set correctly. - Repeat the above for the live sites (containers).