Skip to content

Feature/getting started improvements #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 40 additions & 15 deletions pages/docs/overview/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,42 @@ toc: false
## Installation Quick Start

```bash
git clone {{ site.repo }}.git
cd singularity
./autogen.sh
./configure --prefix=/usr/local
make
sudo make install
$ git clone {{ site.repo }}.git
$ cd singularity
$ ./autogen.sh
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
```

## Command Quick Start

### Create a Centos7 image from a CentOS host

It's easiest to build an image on a "compatible" host. Here's a quick
recipe to build a CentOS 7 image on a CentOS host. See
the [bootstrapping section][readme-bootstrapping] of the README for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll have to put the full URL to the README here, this will likely lead to a 404.

the full story and the [tutorials] for deeper advice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here I think

1. Create a file named `centos.def` that contains the following lines.

```
BootStrap: yum
OSVersion: 7
MirrorURL: http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/$basearch/
Include: yum
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this change to the Quickstart, but instead of doing Centos 7, could we do a technology that more users are familiar with, Docker? So provide an example of Bootstrap: docker and then maybe point the user to the folder of example specs for others.

2. Create and bootstrap the image:

```bash
$ sudo singularity create /tmp/Centos7.img
$ sudo singularity bootstrap /tmp/Centos7.img centos.def
```

### Shell into container
```bash
singularity shell --contain /tmp/Centos7.img
$ singularity shell --contain /tmp/Centos7.img
Singularity.Centos7.img> ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
gmk 1 0.0 0.3 115372 1768 pts/6 S 12:23 0:00 /bin/bash --norc --noprofile
Expand All @@ -32,35 +55,37 @@ Singularity.Centos7.img> exit
### I am the same user inside the container as outside the container

```bash
id
$ id
uid=1000(gmk) gid=1000(gmk) groups=1000(gmk),10(wheel),2222(testgroup)
singularity exec /tmp/Centos7.img id
$ singularity exec /tmp/Centos7.img id
uid=1000(gmk) gid=1000(gmk) groups=1000(gmk),10(wheel),2222(testgroup)
````

### Files on the host can be reachable from within the container
```bash
echo "Hello World" > /home/gmk/testfile
singularity exec /tmp/Centos7.img cat /home/gmk/testfile
$ echo "Hello World" > /home/gmk/testfile
$ singularity exec /tmp/Centos7.img cat /home/gmk/testfile
Hello World
````

### Switching operating systems is as easy as pointing to a different image!
```bash
singularity exec /tmp/Centos7.img cat /etc/redhat-release
$ singularity exec /tmp/Centos7.img cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

singularity exec /tmp/SL6.img cat /etc/redhat-release
$ singularity exec /tmp/SL6.img cat /etc/redhat-release
Scientific Linux release 6.8 (Carbon)

singularity exec /tmp/Debian-stable.img cat /etc/debian_version
$ singularity exec /tmp/Debian-stable.img cat /etc/debian_version
8.5

singularity exec /tmp/Ubuntu-trusty.img cat /etc/lsb-release
$ singularity exec /tmp/Ubuntu-trusty.img cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"
````

{% include links.html %}

[readme-bootstrapping]: https://github.com/singularityware/singularity/blob/master/README.md#bootstrapping-new-images
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh oups, disregard my previous comment... forgot about this :)