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: pages/docs/user-docs/docs-create-an-image.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ permalink: create-image
5
5
folder: docs
6
6
---
7
7
8
-
Singularity images are single files which physically contain the container. Singularity images are 'sparse' files in that they start off with a giant hole and thus it does not consume disk space until you fill the hole (e.g. a 1GiB image may start off only taking about 30MiB of physical disk space). As you fill the image by installing files, data, and programs into it you will find it increase in size.
8
+
Singularity images are single files which physically contain the container.
9
9
10
10
The effect of all files existing virtually within a single image greatly simplifies sharing, copying, branching, and other management tasks. It also means that standard file system ACLs apply to access and permission to the container (e.g. I can give read only access to a colleague, or block access completely with a simple chmod command).
11
11
@@ -15,26 +15,27 @@ Singularity will create a default container image of 1GiB using the following co
15
15
16
16
```bash
17
17
$ sudo singularity create container.img
18
-
Creating a sparse image with a maximum size of 1024MiB...
19
-
Formatting image (/sbin/mkfs.ext4)
20
-
Done. Image can be found at: container.img
18
+
Creating a new image with a maximum size of 768MiB...
19
+
Executing image create helper
20
+
Formatting image with ext3 file system
21
+
Done.
21
22
```
22
23
23
24
We can now use the command `ls` to look at the files and permissions of the container:
24
25
25
26
```bash
26
27
$ ls -l container.img
27
-
-rwxr-xr-x. 1 root root 1073741856 Jun 1 08:27 container.img
28
+
-rwxr-xr-x. 1 root root 805306399 Jun 1 08:27 container.img
28
29
```
29
30
30
31
How big is it?
31
32
32
33
```bash
33
34
$ du -sh container.img
34
-
33M container.img
35
+
769M container.img
35
36
```
36
37
37
-
Here we created a new container image called `container.img` in the current directory. You can see the the `ls` command reports it is 1GiB in size, but when checking the actual disk usage, it reports only 33MiB. As we add files to the image, its actual disk usage will increase.
38
+
Here we created a new container image called `container.img` in the current directory.
38
39
39
40
Also, notice the permissions of the container image as it is executable. This is important in that Singularity images can be executed directly (as long as Singularity is installed on the host system).
0 commit comments