You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-20Lines changed: 68 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,18 @@ OPTIONS:
14
14
-w: non-production writable image (ext3)
15
15
16
16
Default is squashfs (recommended)
17
+
17
18
```
18
19
19
20
### Options
20
21
21
22
**Image Format**
22
23
23
-
-`default` (no arguments specified) gives you a squashfs (`*.simg`) image. This is a compressed, reliable, and read only format that is recommended for production images.
24
-
-`-f` builds your image into a sandbox folder. This is ideal for development, as it will produce a working image in a folder on your system.
25
-
-`-w` builds an older format (ext3) image (`*.img`) with `--writable`. This format is not recommended for production images as we have observed degradation of the images over time, and they tend to be upwards of 1.5x to 2x the size of squashfs.
24
+
-`squashfs` (no arguments specified) gives you a squashfs (`*.simg`) image. This is a compressed, reliable, and read only format that is recommended for production images.
25
+
-`sandbox` (`-f`) builds your image into a sandbox **folder**. This is ideal for development, as it will produce a working image in a folder on your system.
26
+
-`ext3` (`-w`) builds an older format (ext3) image (`*.img`). This format is not recommended for production images as we have observed degradation of the images over time, and they tend to be upwards of 1.5x to 2x the size of squashfs.
26
27
27
-
Note that you are able to convert easily from a folder or ext3 image using Singularity 2.4, if your choice is to develop, making changes, and then finalize. This approach is **not** recommended - your changes are not recorded and thus the image not reproducible.
28
+
Note that you are able to convert easily from a folder or ext3 image using Singularity 2.4. If your choice is to develop, making changes, and then finalize, this approach is **not** recommended - your changes are not recorded and thus the image not reproducible.
28
29
29
30
**Mount Points**
30
31
@@ -51,21 +52,6 @@ Intermediate versions built on [Docker Hub](https://hub.docker.com/r/singularity
51
52
52
53
## Examples
53
54
54
-
No need to download anything from this repository! Simply type:
Replace `D:\host\path\where\to\output\singularity\image` with a path on the host filesystem where your Singularity image will be created. Replace `ubuntu:14.04` with the docker image name you wish to convert (it will be pulled from Docker Hub if it does not exist on your host system).
66
-
67
-
`docker2singularity` uses the Docker daemon located on the host system. It will access the Docker image cache from the host system avoiding having to redownload images that are already present locally.
68
-
69
55
## Build a Squashfs Image
70
56
Squashfs is the recommended image type, it is compressed and less prone to degradation over time. You don't need to specify anything special to create it:
71
57
@@ -75,14 +61,76 @@ docker run -v /var/run/docker.sock:/var/run/docker.sock \
75
61
--privileged -t --rm \
76
62
singularityware/docker2singularity:2.4
77
63
ubuntu:14.04
78
-
```
64
+
65
+
Image Format: squashfs
66
+
Inspected Size: 188 MB
67
+
68
+
(1/10) Creating a build sandbox...
69
+
(2/10) Exporting filesystem...
70
+
(3/10) Creating labels...
71
+
(4/10) Adding run script...
72
+
(5/10) Setting ENV variables...
73
+
(6/10) Adding mount points...
74
+
(7/10) Fixing permissions...
75
+
(8/10) Stopping and removing the container...
76
+
(9/10) Building squashfs container...
77
+
Building image from sandbox: /tmp/ubuntu_14.04-2017-09-13-3e51deeadc7b.build
Notice how the image went from 188MB to 60MB? This reduction is even more impressive when we are dealing with
87
+
very large images (e.g., ~3600 down to ~1800). A few notes on the inputs shown above that you should edit:
88
+
89
+
-`/host/path/change/me`: the path you want to have the final image reside. If you are on windows this might look like `D:\host\path\where\to\output\singularity\image`.
90
+
-`ubuntu:14.04`: the docker image name you wish to convert (it will be pulled from Docker Hub if it does not exist on your host system).
91
+
92
+
`docker2singularity` uses the Docker daemon located on the host system. It will access the Docker image cache from the host system avoiding having to redownload images that are already present locally.
93
+
79
94
If you ever need to make changes, you can easily export the squashfs image into either a sandbox folder or ext3 (legacy) image, both of which have writable.
"environment": "# Custom environment shell code should follow\n\n",
126
+
"runscript": "#!/bin/sh\n/bin/bash $@\n"
127
+
},
128
+
"type": "container"
129
+
}
130
+
}
131
+
132
+
```
133
+
86
134
## Build a Sandbox Image
87
135
A sandbox image is a folder that is ideal for development. You can view it on your desktop, cd inside and browse, and it works like a Singularity image. To create a sandbox, specify the `-f` flag:
0 commit comments