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: hands-on-start.md
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ docker run ubuntu:14.04
14
14
# host
15
15
docker ps
16
16
docker ps -a
17
+
docker images
17
18
```
18
19
19
20
- the container has been created, but had nothing to do, so it shut down
@@ -37,6 +38,7 @@ docker ps -a
37
38
38
39
- exit with `exit`
39
40
- 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?
40
42
- you have to delete containers by hand, they will stack up very quickly,
41
43
- you can `docker run` with `-rm` flag to delete the container once it exits
42
44
@@ -46,7 +48,7 @@ docker run --rm ubuntu:14.04
46
48
```
47
49
48
50
# 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))
50
52
- start new container
51
53
52
54
```bash
@@ -131,18 +133,18 @@ ls $HOME/data
131
133
ls $HOME/data/ecoli
132
134
```
133
135
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]`)
135
137
136
138
```bash
137
139
# host
138
140
docker run -v $HOME/data:/data \
139
141
-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 \
142
144
-o /data/ecoli -t 4'
143
145
```
144
146
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`
146
148
147
149
```
148
150
#! /bin/bash
@@ -159,7 +161,10 @@ chmod +x do-assemble.sh
159
161
160
162
# building with Dockerfile
161
163
162
-
```
164
+
- create a Dockerfile
165
+
166
+
```bash
167
+
# host
163
168
FROM ubuntu:14.04
164
169
RUN apt-get update
165
170
RUN apt-get install -y g++ make git zlib1g-dev python
0 commit comments