Docker
Upgrade a standalone container, without docker-compose
A standalone container is upgraded by replacing it: pull the new image, remove the old container and start a new one with the same run command. Your files are stored in the mounted /app/dist/persistent folder and your data in MySQL, so both are preserved.
Before you upgrade
Prepare the upgrade so that you can go back if something goes wrong:
- Take a backup under Settings → Backups. The new release upgrades the database schema at its first start.
- Read the changelog for the releases between your version and the new one.
- Moving to a new major version? Follow Upgrading to v7 first.
1. Pull the new image
Download the newest image of the tag you run:
docker pull ghcr.io/ansibleforms/ansibleforms:7
podman pull ghcr.io/ansibleforms/ansibleforms:7
2. Replace the container
Remove the old container and start a new one with the same run command you used at installation:
docker stop ansibleforms
docker rm ansibleforms
docker run -p 8000:8000 -d -t --mount type=bind,source=/srv/apps/ansibleforms/server/persistent,target=/app/dist/persistent --name ansibleforms -e DB_HOST=192.168.0.1 -e DB_PORT=3306 -e DB_USER=root -e DB_PASSWORD=password ghcr.io/ansibleforms/ansibleforms:7
podman stop ansibleforms
podman rm ansibleforms
podman run -p 8000:8000 -d -t --mount type=bind,source=/srv/apps/ansibleforms/server/persistent,target=/app/dist/persistent --name ansibleforms -e DB_HOST=192.168.0.1 -e DB_PORT=3306 -e DB_USER=root -e DB_PASSWORD=password ghcr.io/ansibleforms/ansibleforms:7
3. Check the upgrade
Follow the container log while it starts. The first start of a new release upgrades the database schema:
docker logs -f ansibleforms
podman logs -f ansibleforms
In AnsibleForms, Help → About shows the version that is running, and Settings → Status shows the health of the database, the schema and the other systems AnsibleForms depends on.
Roll back
To go back to the previous release, run step 2 again with its exact tag, for example ghcr.io/ansibleforms/ansibleforms:7.1.6. If that release does not start on the upgraded database, restore the backup you took under Settings → Backups.