- Docker 1.9 or later
- An existing Docker Hub account to push the images
- An existing dockerized installation, already in production, that needs to be upgraded
On the production calendar server
- Copy the existing configuration files from running container to the service account on the production server
whoami && pwd calendar /home/calendar docker exec calendar.service /bin/cat /var/www/calendar_server/Specific/config.php > ./config.php docker exec calendar.service /bin/cat /var/www/calendar_server/Specific/config.system.php > ./config.system.php
On the build server
- Copy the configuration files from the service account
$HOMEto the build server's
scp email@example.com:config.php ./resources scp firstname.lastname@example.org:config.system.php ./resources
- Open the Dockerfile
- Specify the new Baïkal version (0.4.6 in this example)
RUN curl -LO https://github.com/sabre-io/Baikal/releases/download/0.4.6/baikal-0.4.6.zip && unzip baikal-0.4.6.zip && \ rm -f baikal-0.4.6.zip
- Uncomment the
COPYinstructions to use the existing, previous version
config.system.phpfiles from the
# The Baïkal administration wizard creates these two config files when first run. Preserve them # and save them to the resources/ directory. These files must be preserved for upgrades. # Both files are already in the .gitignore file. # # To use them: uncomment these two lines and copy them to the Specific/ directory, per the # Baïkal upgrade instructions at: http://sabre.io/baikal/upgrade/ COPY resources/config.php /var/www/calendar_server/Specific/ COPY resources/config.system.php /var/www/calendar_server/Specific/
- Build the new image and push it to Docker Hub
imageName="yourdockerhubname/calendar"; \ docker build -t "$imageName" --rm=true . && \ docker push "$imageName"
On the production calendar server
- Kill the running Baïkal instance
docker stop calendar.service docker rm calendar.service
- Pull the latest Baïkal image
docker pull "yourdockerhubname/calendar"
- Start an instance of the upgraded service in the
docker run --name "calendar.service" \ --privileged=true \ -h "calendar" \ -e "CONTAINER_DOMAIN_NAME=yourdomain.name" \ -v "$(pwd)/db":"/var/www/calendar_server/" \ -p "8800:80" \ -d "yourdockerhubname/calendar"
- List the current instances and check if the service is running on the server
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 83d209fefa91 yourdockerhubname/calendar "/runapache2" 2 minutes ago Up 2 minutes 0.0.0.0:8800->80/tcp calendar.service
- Log on to the Baïkal admin page and confirm the new version; logging on to the admin page forces Baïkal to run its upgrade code, update the endpoints, update the database, and so on — do not skip this step.
The config.sys and config.system.php files
These files are updated on every new installation. They contain important,
site-specific data. The most important datum is the
used for authentication. Keep the configuration files in a safe place or
delete them after building the image.
Help! I deployed the upgrade without preserving the configuration files!
First: don't panic.
Log on to the admin console as soon as the Baïkal instance is running and follow
the configuration wizard. Only the
configuration files are changed. The users, calendars, and address books
database is intact, and will become available as soon as the configuration is