Skip to content

Commit 60c099f

Browse files
committed
updating README with working example
1 parent 55bcf9c commit 60c099f

File tree

3 files changed

+51
-8
lines changed

3 files changed

+51
-8
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# CHANGELOG
2+
3+
This is a manually generated log to track changes to the repository for each release.
4+
Each section should include general headers such as **Implemented enhancements**
5+
and **Merged pull requests**. All closed issued and bug fixes should be
6+
represented by the pull requests that fixed them. Critical items to know are:
7+
8+
- renamed commands
9+
- deprecated / removed commands
10+
- changed defaults
11+
- backward incompatible changes (recipe file format? image file format?)
12+
- migration guidance (how to convert images?)
13+
- changed behaviour (recipe sections work differently)
14+
15+
This changelog was started with version of Singularity v2.5, and reflects changes since then.
16+
17+
## [master](https://github.com/singularityware/docker2singularity/tree/master) (master)
18+
- update of Singularity from [v2.4](https://github.com/singularityware/docker2singularity/tree/v2.4) to [v2.5](https://github.com/singularityware/docker2singularity/tree/v2.5), including adding libarchive dependency (v2.5)

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM docker:1.13
22

3-
RUN apk add --update automake libtool python m4 autoconf alpine-sdk linux-headers && \
4-
wget -qO- https://github.com/singularityware/singularity/archive/2.4.tar.gz | tar zxv && \
5-
cd singularity-2.4 && ./autogen.sh && ./configure --prefix=/usr/local && make && make install && \
3+
RUN apk add --update automake libtool libarchive libarchive-dev python m4 autoconf alpine-sdk linux-headers && \
4+
wget -qO- https://github.com/singularityware/singularity/releases/download/2.5.1/singularity-2.5.1.tar.gz | tar zxv && \
5+
cd singularity-2.5.1 && ./autogen.sh && ./configure --prefix=/usr/local && make && make install && \
66
cd ../ && rm -rf singularity-2.4 && \
77
apk del automake libtool m4 autoconf alpine-sdk linux-headers
88

README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ If you want a legacy version, see the following other branches:
4242

4343
- [v2.3](https://github.com/singularityware/docker2singularity/tree/v2.3): Version 2.3 of Singularity. The image format is ext3.
4444
- [v2.4](https://github.com/singularityware/docker2singularity/tree/v2.4): Version 2.4 of Singularity. The default image format is squashfs.
45+
- [v2.5](https://github.com/singularityware/docker2singularity/tree/v2.5): Version 2.5.1 of Singularity. Same as 2.4 but with many bug fixes.
4546

4647
Intermediate versions built on [Docker Hub](https://hub.docker.com/r/singularityware/docker2singularity/tags/). A tag with prefix `v` corresponds to a release of the Singularity software, while the others are in reference to releases of Docker.
4748

@@ -55,11 +56,19 @@ Intermediate versions built on [Docker Hub](https://hub.docker.com/r/singularity
5556
## Build a Squashfs Image
5657
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:
5758

59+
This is a path on my host, the image will be written here
60+
61+
```bash
62+
$ mkdir -p /tmp/test
5863
```
64+
65+
And here is the command to run. Notice that I am mounting the path `/tmp/test` that I created above to `/output` in the container, where the container image will be written (and seen on my host).
66+
67+
```bash
5968
docker run -v /var/run/docker.sock:/var/run/docker.sock \
60-
-v /host/path/change/me:/output \
69+
-v /tmp/test:/output \
6170
--privileged -t --rm \
62-
singularityware/docker2singularity
71+
singularityware/docker2singularity \
6372
ubuntu:14.04
6473

6574
Image Format: squashfs
@@ -83,10 +92,26 @@ Cleaning up...
8392
Final Size: 60MB
8493
```
8594

86-
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:
95+
We can now see the finished image!
96+
97+
```bash
98+
$ ls /tmp/test
99+
ubuntu_14.04-2018-04-27-c7e04ea7fa32.simg
100+
```
101+
102+
And use it!
103+
104+
```bash
105+
$ singularity shell /tmp/test/ubuntu_14.04-2018-04-27-c7e04ea7fa32.simg
106+
Singularity: Invoking an interactive shell within container...
107+
108+
Singularity ubuntu_14.04-2018-04-27-c7e04ea7fa32.simg:~/Documents/Dropbox/Code/singularity/docker2singularity>
109+
```
110+
111+
Take a look again at the generation code above, and notice how the image went from 188MB to 60MB?
112+
This is one of the great things about the squashfs filesystem! This reduction is even more impressive when we are dealing with very large images (e.g., ~3600 down to ~1800). A few notes on the inputs shown above that you should edit:
88113

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`.
114+
- `/tmp/test`: 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`.
90115
-`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).
91116

92117
`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.

0 commit comments

Comments
 (0)