Skip to content

Commit f844c18

Browse files
committed
update hands-on-start
1 parent e2eb779 commit f844c18

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

hands-on-start.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ docker run ubuntu:14.04
1414
# host
1515
docker ps
1616
docker ps -a
17+
docker images
1718
```
1819

1920
- the container has been created, but had nothing to do, so it shut down
@@ -37,6 +38,7 @@ docker ps -a
3738

3839
- exit with `exit`
3940
- if you run same command again, new ubuntu base container will be created
41+
- make a new container, create a file and exit. Restart the container again (`docker start [container ID]`, `docker attach [container ID]`). Are your changes still there?
4042
- you have to delete containers by hand, they will stack up very quickly,
4143
- you can `docker run` with `-rm` flag to delete the container once it exits
4244

@@ -46,7 +48,7 @@ docker run --rm ubuntu:14.04
4648
```
4749

4850
# Building Docker images
49-
- we will build a Docker image for the MEGAHIT short read assembler ([http://angus.readthedocs.org/en/2015/assembling-ecoli.html%3E](http://angus.readthedocs.org/en/2015/assembling-ecoli.html%3E))
51+
- we will build a Docker image for the MEGAHIT short read assembler ([http://angus.readthedocs.org/en/2015/assembling-ecoli.html](http://angus.readthedocs.org/en/2015/assembling-ecoli.html))
5052
- start new container
5153

5254
```bash
@@ -131,18 +133,18 @@ ls $HOME/data
131133
ls $HOME/data/ecoli
132134
```
133135

134-
- we can run megahit command without entering the container like this
136+
- we can run megahit command without entering the container like this (first do `rm -rf [local ecoli dir]`)
135137

136138
```bash
137139
# host
138140
docker run -v $HOME/data:/data \
139141
-it megahit \
140-
sh -c '/home/megahit/megahit --12 /data/*.pe.fq.gz
141-
-r /data/*.se.fq.gz
142+
sh -c '/home/megahit/megahit --12 /data/*.pe.fq.gz \
143+
-r /data/*.se.fq.gz \
142144
-o /data/ecoli -t 4'
143145
```
144146

145-
- we could also put the command in the script and run the script `do-assemble.sh`
147+
- we could also put the command in the script (on host or container) and run the script `do-assemble.sh`
146148

147149
```
148150
#! /bin/bash
@@ -159,7 +161,10 @@ chmod +x do-assemble.sh
159161

160162
# building with Dockerfile
161163

162-
```
164+
- create a Dockerfile
165+
166+
```bash
167+
# host
163168
FROM ubuntu:14.04
164169
RUN apt-get update
165170
RUN apt-get install -y g++ make git zlib1g-dev python
@@ -172,7 +177,7 @@ CMD /data/do-assemble.sh
172177

173178
```bash
174179
# host
175-
docker build -t magahit .
180+
docker build -t megahit .
176181
```
177182

178183
- and run a container

0 commit comments

Comments
 (0)