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-instances.md
+55-2Lines changed: 55 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,13 +96,66 @@ When you are finished with your instance you can clean it up with the [`instance
96
96
$ singularity instance.stop web1
97
97
```
98
98
99
-
If you have multiple instances running and you want to stop all of them, you can do so with a wildcard:
99
+
If you have multiple instances running and you want to stop all of them, you can do so with a wildcard or the -a flag:
100
100
101
101
```
102
102
$ singularity instance.stop \*
103
+
$ singularity instance.stop -a
103
104
```
104
105
105
-
Note that you must escape the wildcard with a backslash like this `\*` to pass it properly.
106
+
Note that you must escape the wildcard with a backslash like this `\*` to pass it properly.
107
+
108
+
## Nginx "Hello-world" in Singularity
109
+
110
+
Let's take a look at setting up a sample nginx web server using instances in Singularity. First we will just create a basic definition file:
111
+
112
+
```
113
+
Bootstrap: docker
114
+
From: nginx
115
+
Includecmd: no
116
+
117
+
%startscript
118
+
nginx
119
+
```
120
+
121
+
All this does is download the official nginx Docker container, convert it to a Singularity image, and tell it to run nginx when you start the instance. Since we're running a web server, we're going to run the following commands as root.
122
+
123
+
```
124
+
# singularity build nginx.img Singularity
125
+
# singularity instance.start nginx.img web1
126
+
```
127
+
128
+
Just like that we've downloaded, built, and ran an nginx Singularity image. And to confirm that it's correctly running:
0 commit comments