forked from sseefried/docker-build-ghc-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NOTES
27 lines (20 loc) · 1.08 KB
/
NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
NOTES
Notes for my blog post
Things Docker does right!
- When you modify a script that is run Docker realises it is different
and will rewind its state back to the point where the ADD command for that
script occurred and then re-run from there. This is important!
- Put all the long running, annoying, downloads at the beginning.
- Add lots of little script files.
- Add script files ONE AT A TIME. This way if you have add a new one then
it won't force a rebuild.
- The original build script had to do things like check whether something
was installed or not. Sanity checks basically. You no longer need to do this!
You know EXACTLY what state it's going to be in.
You can "docker run -it <image> bash" to have a look at the state at any
point of the install process.
- Unfortunately, docker can't know ... really it can't ... whether
adding an "ADD ..." command somewhere in the middle of a list of already
performed commands will affect those later on or not. It has to assume it
will. This is why you have to build the Dockerfile incrementally in a
somewhat careful way.