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 post errors you find in the published version of Docker in Practice here. We'll publish a comprehensive list for everyone's convenience. Thank you!

Susan Harkins
Errata Editor
Manning Publications
lembark (6) [Avatar] Offline
#2
This book -- like all others on Docker from Manning -- describes files being stored in "folders" on linux.

This is wrong: the unit of file storage on *NIX system is a "directory".

This matters because the operations on a directory are different from those on MS folders (e.g., dir's are used as mount points, contain vnodes) and the linux documentation describes them as a "directory" making it hard for people to find supporting documentation.

If the author is really MS Windows "folders" then be specific and say so, otherwise the reader is left gusssing which operating system the book describes.
David M. Karr (83) [Avatar] Offline
#3
I failed to resist responding to this.

I too regret the continued reference to "folder" instead of "directory" in modern Linux documentation, as I was using "directories" on Unix before Windows even existed, but let's be realistic. I sincerely doubt there is anyone who is "confused" by this reference and is wondering what OS is being discussed. Any reasonable person can see these are synonyms, in all but an obscure set of use cases.
David M. Karr (83) [Avatar] Offline
#4
Section 2.2, "The Docker daemon", problem "You want to run a Docker container in the background as a service".

The solution says to run the following command:
--------------------------
docker run -d -i -p 1234:1234 --name daemon ubuntu nc -l 1234
----------------------

When I run this (on CentOS7), it fails with:
-------------------
docker: Error response from daemon: Container command 'nc' not found or does not exist..
-------------------

I've tried several other variations of this (wrapping it in "/bin/sh -c", for instance), and I can't get anything to actually work when adding the later telnet attempt.
David M. Karr (83) [Avatar] Offline
#5
Section 5.2, "Traditional configuration management tools with Docker", Technique 46, "Traditional: using make with Docker".

This section has two examples of piping the contents of a tar file into "docker build". Unfortunately, they cannot work, because the "docker build" command line is using the "." (period) option, not the "-" (dash) option, so they will ignore stdin. Both of those command line should replace "." with "-".
David M. Karr (83) [Avatar] Offline
#6
Section 9.2, "Multi-host Docker", Technique 78, "A seamless Docker cluster with Swarm".

This section has the following text and command lines and output:
-----------------------
You can start up your first agent on your current machine as follows:

h1 $ ip addr show eth0 | grep 'inet '
inet 10.194.12.221/20 brd 10.194.15.255 scope global eth0
h1 $ docker run -d swarm join --addr=10.194.12.221:2375 token://$CLUSTER_ID
9bf2db849bac7b33201d6d258187bd14132b74909c72912e5f135b3a4a7f4e51
h1 $ docker run swarm list token://$CLUSTER_ID
10.194.12.221:2375
h1 $ curl https://discovery-stage.hub.docker.com/v1/clusters/$CLUSTER_ID
["10.194.12.221:2375"]
------------------------------------

The "ip addr show eth0" command is apparently intended to get the current IP address. The information here needs to be more general than this. This command line will succeed in only a small number of cases.

First, you're using the old "eth0" convention for interface names. I don't know the entire landscape of this, but the newer convention uses the "predictable network interface names" scheme (described somewhat at https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/). On my CentOS7 laptop, the primary ethernet interface is named "enp0s25".

In addition, it's even more likely these days that the user will be on a laptop connected to the wifi interface, not the ethernet interface (probably not the correct term for that anymore), which on my CentOS7 box is "wlo1". This is the interface that shows my current IP address at the moment.

I would almost conclude that changing this section to describe how to accurately determine the current IP address would result in the section having very little information about Docker, relatively. smilie It might be better to throw up your hands and just tell the reader to determine their current IP address.
aidanhs (25) [Avatar] Offline
#7
Hi lembark

lembark wrote:This book -- like all others on Docker from Manning -- describes files being stored in "folders" on linux.


David's answer captures my thoughts here. The "directory" terminology is indeed more precise, and were this a book on POSIX or the internals of Linux I would hastily go and correct all relevant cases. However, Docker in Practice generally just treats them as "filesystem things containing other filesystem things" and I feel either "directory" or "folder" are sufficient to communicate that meaning.

---------------

Hi David

David M. Karr wrote:Section 2.2, "The Docker daemon", problem "You want to run a Docker container in the background as a service".

The solution says to run the following command:
--------------------------
docker run -d -i -p 1234:1234 --name daemon ubuntu nc -l 1234
----------------------

When I run this (on CentOS7), it fails with:
-------------------
docker: Error response from daemon: Container command 'nc' not found or does not exist..
-------------------

I've tried several other variations of this (wrapping it in "/bin/sh -c", for instance), and I can't get anything to actually work when adding the later telnet attempt.


You have stumbled across an unintentional demonstration of why you should always carefully consider adding a tag when specifying an image! This should be `ubuntu:14.04` (which `ubuntu` corresponded to at time of book release) and I'll add it to our errata list.

David M. Karr wrote:Section 5.2, "Traditional configuration management tools with Docker", Technique 46, "Traditional: using make with Docker".

This section has two examples of piping the contents of a tar file into "docker build". Unfortunately, they cannot work, because the "docker build" command line is using the "." (period) option, not the "-" (dash) option, so they will ignore stdin. Both of those command line should replace "." with "-".


Added to the errata list, thanks.

David M. Karr wrote:The "ip addr show eth0" command is apparently intended to get the current IP address. The information here needs to be more general than this. This command line will succeed in only a small number of cases.


Yes, you're absolutely right. I think I'll replace it in the errata with `ip addr | grep 'inet ' | grep -v 'lo$\|docker0$'` as briefly explained in technique 66, along with a comment saying "get external IP address" to hint at the intention. Virtualbox users may end up swamped with large numbers of addresses, but it's an improvement at least.

Thanks for reporting.
420549 (1) [Avatar] Offline
#8
Please Remove. My mistake
Susan Harkins (424) [Avatar] Offline
#9