Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| infra:howto:apptainer_sample [2025/03/03 10:01] – remi | infra:howto:apptainer_sample [2025/03/03 10:24] (current) – remi | ||
|---|---|---|---|
| Line 72: | Line 72: | ||
| When you already have a Docker image for your job, you have several options to migrate to Apptainer : | When you already have a Docker image for your job, you have several options to migrate to Apptainer : | ||
| - | * You can convert | + | ### From Dockerhub |
| - | | + | If you have your image ready on DockerHub, then you can simply run from the server : |
| - | ```bash | + | ```bash |
| - | sudo apptainer build yourapplication.sif docker-daemon:// | + | apptainer build ./datasets/yourapplication.sif docker:// |
| - | + | | |
| - | [sudo] password for user.name: | + | |
| INFO: Starting build... | INFO: Starting build... | ||
| - | Copying blob 27123a71e85e | + | Copying blob 5a7813e071bf |
| - | Copying config | + | Copying config |
| Writing manifest to image destination | Writing manifest to image destination | ||
| - | 2025/ | + | 2025/ |
| INFO: Creating SIF file... | INFO: Creating SIF file... | ||
| - | INFO: Build complete: yourapplication.sif | + | INFO: Build complete: |
| - | scp yourapplication.sif user.name@chacha:/ | + | ``` |
| - | ``` | + | |
| + | ### From local image | ||
| + | You can convert your image to an Apptainer | ||
| - | | + | |
| - | ```bash | + | ```bash |
| + | sudo apptainer build yourapplication.sif docker-daemon:// | ||
| + | |||
| + | [sudo] password for user.name: | ||
| + | INFO: Starting build... | ||
| + | Copying blob 27123a71e85e done | | ||
| + | Copying config 388ea0fa6e done | | ||
| + | Writing manifest to image destination | ||
| + | 2025/03/03 10: | ||
| + | INFO: Creating SIF file... | ||
| + | INFO: Build complete: yourapplication.sif | ||
| + | |||
| + | scp yourapplication.sif user.name@chacha:/ | ||
| + | ``` | ||
| + | |||
| + | 2. You can also build the .sif from a docker archive : | ||
| + | ```bash | ||
| sudo docker save yourapplication: | sudo docker save yourapplication: | ||
| Line 107: | Line 124: | ||
| ``` | ``` | ||
| + | ### From Dockerfile | ||
| + | |||
| + | You can convert your Docker file to an Apptainer definition file using this conversion table : https:// | ||
| + | |||
| + | TODO: Script a converter | ||
