The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Susan Harkins (424) [Avatar] Offline
#1
Please list errors found in the published version of Docker in Action here. We'll publish a comprehensive list for everyone's convenience. Thank you!

Susan Harkins
Errata Editor
Manning Publications
thompson2526@gmail.com (30) [Avatar] Offline
#2
page 49, para 4: *.jar != *.tar
The TIP text implies that a java *.jar file is nothing more than a renamed *.tar file. This is incorrect.

It is true that a JAR file is a ZIP archive, plus the META-INF directory. However, the TAR format is completely different.

~ > echo test > test.txt
~ > tar cf test.tar test.txt 
~ > jar cf test.jar test.txt
~ > file test.tar test.jar
test.tar: POSIX tar archive (GNU)
test.jar: Java archive data (JAR)


thompson2526@gmail.com (30) [Avatar] Offline
#3
page 50, para 2
The README.md in the git repo says:

First clone the repo and change into the newly created directory. Then run:

    docker build -t dockerinaction/ch3_dockerfile .

After doing so, you will have built the image. To run the example run:

    docker run --rm dockerinaction/ch3_dockerfile 


but the correct commands are
 
docker run --rm dia_ch3/dockerfile
docker rmi      dia_ch3/dockerfile 


thompson2526@gmail.com (30) [Avatar] Offline
#4
Errata: page 74, last line
The last line contains the text
ls /operations/*
. This causes an error on Ubuntu 15.10 with zsh:
> docker run --rm --volumes-from tools alpine:latest ls /operations/*
zsh: no match


I haven't figured out a good way to escape the wildcard (tried single quotes and backslash briefly). The simplest way to fix the problem is to avoid the wildcard:
 
> docker run --rm --volumes-from tools alpine:latest ls -lR /operations
/operations:
total 4
drwxr-xr-x    2 root     root          4096 Mar 22 01:14 tools

/operations/tools:
total 4
-rwxr-xr-x    1 root     root            57 Mar 22 01:14 diagnostics
thompson2526@gmail.com (30) [Avatar] Offline
#5
Errata: page 75, line 4
Need to change from "someTool" to "diagnostics":

# this one fails
~/gh > docker exec important_application /operations/tools/someTool
exec: "/operations/tools/someTool": stat /operations/tools/someTool: no such file or directory

# this one works
~/gh > docker exec important_application /operations/tools/diagnostics
This is not a real tool, but it could be.

thompson2526@gmail.com (30) [Avatar] Offline
#6
Errata: page 86, para "last"
On Ubuntu 15.10, this example produces confusing results:

 > dk  run --rm --hostname barker alpine:latest nslookup barker   
nslookup: can't resolve '(null)': Name does not resolve

Name:      barker
Address 1: 172.17.0.2 barker

Is this correct?
thompson2526@gmail.com (30) [Avatar] Offline
#7
Errata: page 102, top figure
This text is repeated twice:
Container B depends on A:
container A’s IP address
is written into container B


I believe the 2nd time (RHS) is meant to show dependence of C on B, correct?
thompson2526@gmail.com (30) [Avatar] Offline
#8
Errata: page 106 "docker run" example
The image name
dockerfile/mariadb
seems to be incorrect
thompson2526@gmail.com (30) [Avatar] Offline
#9
Errata: page 107, last para
The math for relative CPU weight doesn't work out. To make the 3rd container get 50% of the CPU with Maria & WP at a 2:1 ration, use something like
MariaDB = 100
Wordpress = 50
"3rd app" = 150


Also, using power-of-2 values seems overly confusing for no benefit.
thompson2526@gmail.com (30) [Avatar] Offline
#10
Errata: page 110, 1st example
The work "run" is missing in both lines of the example. Should look like:
docker run -d -u nobody --name ch6_ipc_producer dockerinaction/ch6_ipc -producer


Same problem is in example at bottom of page.

....and at the end of page 111.
thompson2526@gmail.com (30) [Avatar] Offline
#11
Errata: page 115, first para
Text
can accept any user or group pair.
should be
can accept any user or user:group pair.
or something similar.
thompson2526@gmail.com (30) [Avatar] Offline
#12
Errata: page 115, 2nd example
This does not work on Ubuntu 15.10:
> docker run -it --name escalation -u nobody busybox:latest /bin/sh -c "whoami; su -c whoami"
nobody
su: must be suid to work properly

thompson2526@gmail.com (30) [Avatar] Offline
#13
Errata:page 119, first example
capsh -print

appears to be a single dash. It needs to be 2 dashes:
 capsh --print 

thompson2526@gmail.com (30) [Avatar] Offline
#14
Errata: page 240, para 1
File pathname is wrong, should be
gvim coffee/app/api.py 
thompson2526@gmail.com (30) [Avatar] Offline
#15
Errata: page 238/240
The command
docker-compose up
should really be
docker-compose up -d
, otherwise, the output takes over the terminal. This means the user must kill the system on page 240 before the commands:
docker-compose build coffee
docker-compose up -d

thompson2526@gmail.com (30) [Avatar] Offline
#16
Errata: page 240, feature-ping branch
This branch has another difference. A git diff of feature-ping compared to master shows:
--- a/proxy/app.conf
+++ b/proxy/app.conf
@@ -1,5 +1,5 @@
 upstream appservers {
-  server ch11coffeeapi_coffee_1:3000;
+  server ch11coffeeapisingle_coffee_1:3000;
 }
 
 server {


Is the change to "ch11coffeeapisingle_coffee_1" intended or an accident?
thompson2526@gmail.com (30) [Avatar] Offline
#17
Errata: page 242, last para
The line
The
environment was in a constant state of flux, and at some point when the api service
was running, the service was renamed to coffee . When that happened,


should look like

Imagine the
environment was in a constant state of flux, and at some point when the api service
was running, the service was renamed to coffee . After that, Compose would no longer be aware...
thompson2526@gmail.com (30) [Avatar] Offline
#18
Errata: page 262, para 3
Text should change "flock.json" -> "flock.yml"
thompson2526@gmail.com (30) [Avatar] Offline
#19
Errata: page 257, machine creation example
Hi, this is not an error but a possible enhancement. I found these examples easier to do (cut/paste) by reformatting like so:

token=$( docker run --rm swarm create )
echo $token

docker-machine create \
  --driver virtualbox \
  --swarm \
  --swarm-discovery token://${token} \
  --swarm-master \
  machine0-manager

docker-machine create \
  --driver virtualbox \
  --swarm \
  --swarm-discovery token://${token} \
  machine1

docker-machine create \
  --driver virtualbox \
  --swarm \
  --swarm-discovery token://${token} \
  machine2

# show current state:
docker-machine ls
  #=> NAME               ACTIVE   DRIVER       STATE     URL                         SWARM                       DOCKER    ERRORS
  #=> local              *        virtualbox   Running   tcp://192.168.99.100:2376                               v1.10.3   
  #=> machine0-manager   -        virtualbox   Running   tcp://192.168.99.101:2376   machine0-manager (master)   v1.10.3   
  #=> machine1           -        virtualbox   Running   tcp://192.168.99.102:2376   machine0-manager            v1.10.3   
  #=> machine2           -        virtualbox   Running   tcp://192.168.99.103:2376   machine0-manager            v1.10.3   

thompson2526@gmail.com (30) [Avatar] Offline
#20
Errata: page 265, last example
This results in a deprecation warning:

 > docker run -d  -e constraint:size==xxl  -m 4G -c 512 postgres

Warning: '-c' is deprecated, it will be replaced by '--cpu-shares' soon. See usage.
docker: Error response from daemon: no resources available to schedule container.
See 'docker run --help'.
thompson2526@gmail.com (30) [Avatar] Offline
#21
Errata: page 271, "curl" command
Perhaps I have made a mistake, but I am not seeing the machine prefix for my swarm:

~/tmp/ch12_coffee_api > docker ps  
CONTAINER ID        IMAGE                              COMMAND                  CREATED             STATUS              PORTS                                     NAMES
f571754ec84e        dockerinaction/ch12-coffee-proxy   "nginx -g 'daemon off"   14 minutes ago      Up 14 minutes       80/tcp, 443/tcp, 0.0.0.0:8080->8080/tcp   ch12coffeeapi_proxy_1
d12f2d27a821        dockerinaction/ch12-coffee         "./entrypoint.sh"        14 minutes ago      Up 14 minutes       3000/tcp                                  ch12coffeeapi_coffee_1
9648949164c9        postgres                           "/docker-entrypoint.s"   17 minutes ago      Up 17 minutes       5432/tcp                                  ch12coffeeapi_db_1
7ddae938c795        swarm:latest                       "/swarm join --advert"   About an hour ago   Up About an hour                                              swarm-agent
6e843e49f7b4        swarm:latest                       "/swarm manage --tlsv"   About an hour ago   Up About an hour                                              swarm-agent-master
~/tmp/ch12_coffee_api > 


This is what happens when I try the "curl" command:

~/tmp/ch12_coffee_api > docker-machine ls
NAME               ACTIVE   DRIVER       STATE     URL                         SWARM                       DOCKER    ERRORS
local              -        virtualbox   Running   tcp://192.168.99.100:2376                               v1.10.3   
machine0-manager   *        virtualbox   Running   tcp://192.168.99.101:2376   machine0-manager (master)   v1.10.3   
machine1           -        virtualbox   Running   tcp://192.168.99.102:2376   machine0-manager            v1.10.3   
machine2           -        virtualbox   Running   tcp://192.168.99.103:2376   machine0-manager            v1.10.3   
~/tmp/ch12_coffee_api > curl http://$(dkm ip machine0-manager):8080/api/coffeeshops 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="http://192.168.99.101:8080/api/coffeeshops/">http://192.168.99.101:8080/api/coffeeshops/</a>.  If not click the link.%                                           ~/tmp/ch12_coffee_api > curl http://$(dkm ip machine1):8080/api/coffeeshops       
curl: (7) Failed to connect to 192.168.99.102 port 8080: Connection refused
~/tmp/ch12_coffee_api > curl http://$(dkm ip machine2):8080/api/coffeeshops
curl: (7) Failed to connect to 192.168.99.103 port 8080: Connection refused


Am I missing something?
351623 (2) [Avatar] Offline
#22
pBook, Section 2.2.1, Page 18, Code Block 1:

docker run -d \
    --name mailer \


results in

docker: "run" requires a minimum of 1 argument.
See 'docker run --help'.

Usage:	docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container


It appears this example is missing an image name and a command, maybe?
351623 (2) [Avatar] Offline
#23
351623 wrote:pBook, Section 2.2.1, Page 18, Code Block 1:

docker run -d \
    --name mailer \


results in

docker: "run" requires a minimum of 1 argument.
See 'docker run --help'.

Usage:	docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container


It appears this example is missing an image name and a command, maybe?


Looks like this command should be:


docker run -d \ 
    --name mailer \ 
    dockerinaction/ch2_mailer
392879 (2) [Avatar] Offline
#24
Really annoying that they didn't fix that error yet.

Just bought the electronic version a couple weeks ago and it was still missing that line.

2016-04-12 - Still hasn't been updated smilie
392879 (2) [Avatar] Offline
#25
Page 32: Section 2.5.1 problem with read-only file
When it creates WP_CID it forgets to add the /tmp/ directory
WP_CID=$(docker create --link $SQL_CID:mysql -p 80 \
    -v /run/lock/apache2/ -v /run/apache2/ \
    --read-only wordpress:4)


should be

WP_CID=$(docker create --link $SQL_CID:mysql -p 80 \
    -v /run/lock/apache2/ -v /run/apache2/ \
    -v /tmp/ --read-only wordpress:4)
boyarsky (67) [Avatar] Offline
#26
page 93: appendix B
Page 93 refers to Appendix B for a CIDR primer, but there are no appendixes.
boyarsky (67) [Avatar] Offline
#27
page 96 typo
The second paragraph on page 96 says "try do gain access" instead of "try to gain access"
David M. Karr (83) [Avatar] Offline
#28
Errata: page 86, para "last"
thompson2526@gmail.com wrote:On Ubuntu 15.10, this example produces confusing results:

 > dk  run --rm --hostname barker alpine:latest nslookup barker   
nslookup: can't resolve '(null)': Name does not resolve

Name:      barker
Address 1: 172.17.0.2 barker

Is this correct?


I got the same, and I did a little research. It appears that Alpine Linux doesn't know what nameserver to use unless you tell it, so running "nslookup barker localhost" gets better output.
David M. Karr (83) [Avatar] Offline
#29
In section 5.7.3, "Environment modifications", the following text has one minor technical error:
-----------------------------
One additional environment variable of the form <ALIAS>_<PORT> will be created and will contain connection information for one of the exposed ports in URL form.
----------------------

This should actually be:
--------
One additional environment variable of the form <ALIAS>_PORT will be created and will contain connection information for one of the exposed ports in URL form.
---------------

Rendering it as "<PORT>" implies this is substituted with a port number. The actual variable just ends with the string "_PORT".
David M. Karr (83) [Avatar] Offline
#30
Errata: page 102, top figure
thompson2526@gmail.com wrote:This text is repeated twice:
Container B depends on A:
container A’s IP address
is written into container B


I believe the 2nd time (RHS) is meant to show dependence of C on B, correct?


That's figure 5.12, if it matters.
David M. Karr (83) [Avatar] Offline
#31
Errata: page 106 "docker run" example
thompson2526@gmail.com wrote:The image name
dockerfile/mariadb
seems to be incorrect


I thought that just removing "dockerfile/" worked for me, but I noticed later that the container exited immediately with the familiar "database is uninitialized and password option is not specified" error.
David M. Karr (83) [Avatar] Offline
#32
Chapter 6.

Several command lines between sections 6.1.3 and 6.2.2 that should refer to "docker run" are missing the "run" keyword, so they fail immediately with errors like this:
----------------------
flag provided but not defined: -it
See 'docker --help'.
-------------------

The lines in error are:
* docker -it --rm --device /dev/video0:/dev/video0 ubuntu:latest ls -al /dev
* docker -d -u nobody --name ch6_ipc_producer dockerinaction/ch6_ipc -producer
* docker -d -u nobody --name ch6_ipc_consumer dockerinaction/ch6_ipc -consumer (twice)
* docker -d --name ch6_ipc_producer --ipc host dockerinaction/ch6_ipc -producer
* docker -d --name ch6_ipc_consumer --ipc host dockerinaction/ch6_ipc -consumer
David M. Karr (83) [Avatar] Offline
#33
Section 7.1.2, "Preparing packaging for Git".

This section says to create a fresh "ubuntu:latest" container, run "/bin/bash" on it, and suggests that I install git by running "apt-get -y install git".

This fails, because a freshly created Ubuntu container needs the apt cache initialized with "apt-get update". This takes several minutes to complete. Once it completes, the described installation of git succeeds.
David M. Karr (83) [Avatar] Offline
#34
Section 8.1, "Packaging Git with a Dockerfile".

Similar to the issue in section 7.1.2, "Preparing packaging for git", you can't install git on a fresh ubuntu container without first updating the cache with "apt-get update", so the initial Dockerfile needs to do this:
--------------------
FROM ubuntu:latest
MAINTAINER "dockerinaction@allingeek.com"
RUN apt-get update
RUN apt-get install -y git
ENTRYPOINT ["git"]
---------------------

If it matters, without that additional line, the image build fails with this:
---------------------------
E: Unable to locate package git
The command '/bin/sh -c apt-get install -y git' returned a non-zero code: 100
-------------------------
David M. Karr (83) [Avatar] Offline
#35
Section 12.3.2, "Fine-tune scheduling with filters", has the following text in the last paragraph of the section:
------------------
Automatically scaling the number of nodes in a cluster is feasible when only some nodes become unused.
------------------

This should actually read:
------------------
Automatically scaling down the number of nodes in a cluster is feasible when only some nodes become unused.
------------------

As it is conceivable that you could scale UP the number of nodes, and the subject of this paragraph is automatically removing unused nodes, the sentence should specify that we're talking about scaling down.
Susan Harkins (424) [Avatar] Offline
#36
The current errata list is available at https://manning-content.s3.amazonaws.com/download/3/8ec991d-b454-4b54-b375-3a2969ed37ba/Nickoloff_DockerinAction_err1.html.

Thank you!
Susan Harkins
Errata Editor
DockerWalloper (2) [Avatar] Offline
#37
Errata - Page 32 - Issue with WordPress with read-only example
This issue was already reported in the right section - https://forums.manning.com/posts/list/34881.page#p108446

DockerWalloper at Gmail
Ozren Harlovic (28) [Avatar] Offline
#38
Typo in section 5.7.2
"...a database will be have an alias ..."
rjray (5) [Avatar] Offline
#39
Errata - Page 32 - Issue with WordPress with read-only example (paths)
Going from the previous report, I used:

WP_CID=$(docker create --link $SQL_CID:mysql -p 80 \
    -v /run/lock/apache2/ -v /run/apache2/ \
    -v /tmp/ --read-only wordpress:4)


However, I got the following error:

[core:error] [pid 1] (30)Read-only file system: AH00099: could not create /var/run/apache2/apache2.pid


This is because the Apache2 server expects to write to /var/run/...

This worked:

WP_CID=$(docker create --link $SQL_CID:mysql -p 80 \
    -v /var/run/lock/apache2/ -v /var/run/apache2/ \
    -v /tmp/ --read-only wordpress:4)


(This might be a change in the wordpress image since the book was written.)

-Randy
rjray (5) [Avatar] Offline
#40
Possible run-on of sentences on page 106
At the top of page 106, after the text of the paragraph that is continued from page 105, is the specification of the format for the --memory flag. Immediately after the format is the phrase, "where unit = b, k, m or g". This seems to be a run-on, in that is isn't actually part of the format spec, it's definition of the "<optional unit>" part. Should this have been on a separate line, and rendered in proportional font?

Also, it might be useful to tell what "unit" defaults to, since it is optional.

-Randy
rjray (5) [Avatar] Offline
#41
Errata - Mismatched filenames (?) on page 130
The third example at the top of page 130 (the "tweak-c" container) passes a command of "touch /bin/vi" on the "docker run" command line. But the output for "docker diff" shows the changed file as being /bin/busybox. Further, when I ran these commands under the latest docker and latest busybox image, the output from "docker diff" showed pretty much *every* file in /bin as changed.
Hebol (2) [Avatar] Offline
#42
Section 2.5.2, page 34 Wrong type of quotation marks
The last sample on the page has wrong type as closing quotation mark
echo "Client ID not set”


should be
echo "Client ID not set"
Devin (1) [Avatar] Offline
#43
Errata: `apt-get install ...` invocation won't work without prior `apt-get update` invocation
Based on content on page 129 in section 7.1.2:

danderso@bur-lpl5g:~$ docker run -it --name image-dev ubuntu:latest /bin/bash
root@e0cf37e21e67:/# apt-get -y install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package git
root@e0cf37e21e67:/# apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:3 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [30.3 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [320 kB]
...
Get:21 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [2567 B]
Fetched 23.9 MB in 4s (5585 kB/s)
Reading package lists... Done
root@e0cf37e21e67:/# apt-get -y install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
...
Running hooks in /etc/ca-certificates/update.d...
done.
root@e0cf37e21e67:/#
5979 (1) [Avatar] Offline
#44
Errata - Section 8.2.1 Metadata instructions - Step 6 Description Missing
Description of Step 6 : ADD . $APPROOT instruction is completely missing and it's not an instruction we've seen before as covered in the following paragraph.

“Step 5 : WORKDIR $APPROOT
---> Running in 073583e0d554
---> 363129ccda97
Removing intermediate container 073583e0d554

The result of the WORKDIR instruction will be an image with the default working directory set to /app. Setting WORKDIR to a location that doesn’t exist will create that location just like the command-line option. Last, the EXPOSE command creates a layer that opens TCP port 33333:

Step 7 : EXPOSE 33333
---> Running in a6c4f54b2907
---> 86e0b43f234a
Removing intermediate container a6c4f54b2907”

Excerpt From: Jeff Nickoloff. “Docker in Action.” iBooks.

The relevant section in the reference for ADD is here: https://docs.docker.com/engine/reference/builder/#add

The quality of Manning books has really gone down hill. This book couldn't possibly have been reviewed and even when MEAP readers called out issues, they were never corrected in the final release.
54214 (1) [Avatar] Offline
#45
https://forums.manning.com/posts/list/37916.page#p106170

392879 wrote:Really annoying that they didn't fix that error yet.

Just bought the electronic version a couple weeks ago and it was still missing that line.

2016-04-12 - Still hasn't been updated smilie


2018-06-18 and still not corrected…
Susan Harkins (424) [Avatar] Offline
#46
Thank you for your insight -- we really do appreciate it. I'm sorry you're disappointed, and I totally get it. Your expectations aren't unreasonable. Right now, our production process pushes through corrections when the print version is reprinted, if there's adequate time to meet distribution needs. We realize that the current process is imperfect, and it's something we're trying to improve. We're working on it. Thank you!

Susan Harkins
Errata Editor