Use a 12-factor app rock¶
The following how-to guide provides instructions on using rocks for 12-factor apps.
Note
The Ubuntu 26.04 LTS extensions, and the Spring Boot extension on any base,
are experimental. To use them, set
ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=1 when running
rockcraft pack. For details, see
Ubuntu 26.04 LTS framework extensions.
Update and deploy the OCI image¶
After making a change to your app:
Include any new files in the new OCI image, as described in Include extra files in the OCI image.
Run
rockcraft packto create the new OCI image.To upload the OCI image to the local Docker registry, run:
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \ oci-archive:<path to rock file> \ docker://localhost:32000/<rock name>:<rock version>
To deploy the new OCI image, run:
juju refresh <app name> --path=<relative path to .charm file> \ --resource flask-app-image=<localhost:32000/<rock name>:<rock version>>
juju refresh <app name> --path=<relative path to .charm file> \ --resource app-image=<localhost:32000/<rock name>:<rock version>>
After making a change to your app:
Include any new files in the new OCI image, as described in Include extra files in the OCI image.
Run
rockcraft packto create the new OCI image.To upload the OCI image to the local Docker registry, run:
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \ oci-archive:<path to rock file> \ docker://localhost:32000/<rock name>:<rock version>
To deploy the new OCI image, run:
juju refresh <app name> --path=<relative path to .charm file> \ --resource django-app-image=<localhost:32000/<rock name>:<rock version>>
juju refresh <app name> --path=<relative path to .charm file> \ --resource app-image=<localhost:32000/<rock name>:<rock version>>
After making a change to your app:
Include any new files in the new OCI image, as described in Include extra files in the OCI image.
Run
rockcraft packto create the new OCI image.To upload the OCI image to the local Docker registry, run:
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \ oci-archive:<path to rock file> \ docker://localhost:32000/<rock name>:<rock version>
To deploy the new OCI image, run:
juju refresh <app name> --path=<relative path to .charm file> \ --resource app-image=<localhost:32000/<rock name>:<rock version>>
After making a change to your app:
Include any new files in the new OCI image, as described in Include extra files in the OCI image.
Run
rockcraft packto create the new OCI image.To upload the OCI image to the local Docker registry, run:
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \ oci-archive:<path to rock file> \ docker://localhost:32000/<rock name>:<rock version>
To deploy the new OCI image, run:
juju refresh <app name> --path=<relative path to .charm file> \ --resource app-image=<localhost:32000/<rock name>:<rock version>>
After making a change to your app:
Include any new files in the new OCI image, as described in Include extra files in the OCI image.
Run
rockcraft packto create the new OCI image.To upload the OCI image to the local Docker registry, run:
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \ oci-archive:<path to rock file> \ docker://localhost:32000/<rock name>:<rock version>
To deploy the new OCI image, run:
juju refresh <app name> --path=<relative path to .charm file> \ --resource app-image=<localhost:32000/<rock name>:<rock version>>
After making a change to your app:
Include any new files in the new OCI image, as described in Include extra files in the OCI image.
Run
rockcraft packto create the new OCI image.To upload the OCI image to the local Docker registry, run:
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \ oci-archive:<path to rock file> \ docker://localhost:32000/<rock name>:<rock version>
To deploy the new OCI image, run:
juju refresh <app name> --path=<relative path to .charm file> \ --resource app-image=<localhost:32000/<rock name>:<rock version>>