{"id":15650049,"url":"https://github.com/kaczmarj/apptainer-in-docker","last_synced_at":"2025-04-13T12:09:55.190Z","repository":{"id":110052830,"uuid":"165123466","full_name":"kaczmarj/apptainer-in-docker","owner":"kaczmarj","description":"Apptainer in Docker!","archived":false,"fork":false,"pushed_at":"2024-11-29T14:25:23.000Z","size":25,"stargazers_count":46,"open_issues_count":3,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-13T12:09:50.817Z","etag":null,"topics":["apptainer","containers","docker","hpc","singularity","singularity-container"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaczmarj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-10T20:06:31.000Z","updated_at":"2025-03-21T09:49:45.000Z","dependencies_parsed_at":"2024-10-03T12:33:16.373Z","dependency_job_id":"a16d0595-fb1f-486c-80af-456661796b76","html_url":"https://github.com/kaczmarj/apptainer-in-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fapptainer-in-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fapptainer-in-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fapptainer-in-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaczmarj%2Fapptainer-in-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaczmarj","download_url":"https://codeload.github.com/kaczmarj/apptainer-in-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710446,"owners_count":21149190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apptainer","containers","docker","hpc","singularity","singularity-container"],"created_at":"2024-10-03T12:33:08.150Z","updated_at":"2025-04-13T12:09:55.172Z","avatar_url":"https://github.com/kaczmarj.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apptainer in Docker\n\n[![Docker images available at kaczmarj/apptainer](https://img.shields.io/badge/DockerHub-kaczmarj/apptainer-blue)](https://hub.docker.com/r/kaczmarj/apptainer)\n[![Docker pulls](https://img.shields.io/docker/pulls/kaczmarj/apptainer)](https://hub.docker.com/r/kaczmarj/apptainer)\n[![Docker pulls](https://img.shields.io/docker/pulls/kaczmarj/singularity)](https://hub.docker.com/r/kaczmarj/singularity)\n\nThe Dockerfile in this repository builds Apptainer. The resulting Docker image can be used on any system with Docker to build Apptainer images. This project is targeted towards high-performance computing users who have Apptainer/Singularity installed on their clusters but do not have Apptainer/Singularity on their local computers to build images.\n\n\n**Note**: This project previously built Singularity.\nSee the [Linux Foundation post](https://www.linuxfoundation.org/press/press-release/new-linux-foundation-project-accelerates-collaboration-on-container-systems-between-enterprise-and-high-performance-computing-environments) regarding the name change to Apptainer.\n\n## Convert local Docker image to Apptainer format\n\nIn the following example, we convert an existing Docker image to Apptainer format.\n\n```bash\n$ docker pull alpine:3.18.2\n$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/work \\\n    kaczmarj/apptainer build alpine_3.18.2.sif docker-daemon://alpine:3.18.2\n```\n\nThis output `.sif` file will be owned by root, so you can change ownership:\n\n```bash\nsudo chown USER:GROUP alpine_3.18.2.sif\n```\n\n## Build Apptainer image in Docker\n\nWith the following command, we build a small Apptainer image defined in [`test_alpine.def`](test_alpine.def). This Apptainer image will be saved in the current directory `myimage.sif`.\n\n```bash\n$ docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer \\\n  build myimage.sif test_alpine.def\n```\n\n## Run Apptainer image in Docker\n\nOne can run a Apptainer image within this Docker image. This is not recommended, but it is possible.\n\n```bash\n$ docker run --rm --privileged kaczmarj/apptainer \\\n  run shub://GodloveD/lolcow\n```\n\nHere is the output:\n\n```\nINFO:    Downloading shub image\n87.6MiB / 87.6MiB [======================================================================================================================================================] 100 % 1.4 MiB/s 0s\n _________________________________________\n/ He that is giddy thinks the world turns \\\n| round.                                  |\n|                                         |\n| -- William Shakespeare, \"The Taming of  |\n\\ the Shrew\"                              /\n -----------------------------------------\n        \\   ^__^\n         \\  (oo)\\_______\n            (__)\\       )\\/\\\n                ||----w |\n                ||     ||\n```\n\n## Build image\n\nApptainer version 1.2.0:\n\n```bash\n$ docker build --build-arg APPTAINER_COMMITISH=v1.2.0 -t apptainer:1.2.0 .\n```\n\nBleeding-edge (main branch):\n\n```bash\n$ docker build --build-arg APPTAINER_COMMITISH=main -t apptainer:latest .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaczmarj%2Fapptainer-in-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaczmarj%2Fapptainer-in-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaczmarj%2Fapptainer-in-docker/lists"}