Boot2docker: Can't install tcpdump in boot2docker

Created on 8 Jan 2017  路  7Comments  路  Source: boot2docker/boot2docker

I'm getting the following error trying to install tcpdump in a 1.12.5 (I have also tried 1.13-rc5) boot2docker machine

$ docker-machine create -d virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying /home/marius/.docker/machine/cache/boot2docker.iso to /home/marius/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env default
$ docker-machine ssh
                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.12.5, build HEAD : fc49b1e - Fri Dec 16 12:44:49 UTC 2016
Docker version 1.12.5, build 7392c3b
docker@default:~$ tce-load -wi tcpdump.tcz
tcpdump.tcz.dep OK
libpcap.tcz.dep OK
libusb.tcz.dep OK
Downloading: libnl.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
libnl.tcz            100% |***********************************************************************************|   184k  0:00:00 ETA
libnl.tcz: OK
Downloading: udev-lib.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
udev-lib.tcz         100% |***********************************************************************************| 24576   0:00:00 ETA
udev-lib.tcz: OK
Downloading: libusb.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
libusb.tcz           100% |***********************************************************************************| 40960   0:00:00 ETA
libusb.tcz: OK
Downloading: libpcap.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
libpcap.tcz          100% |***********************************************************************************|   116k  0:00:00 ETA
libpcap.tcz: OK
Downloading: openssl.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
openssl.tcz          100% |***********************************************************************************|  2100k  0:00:00 ETA
openssl.tcz: OK
Downloading: netfilter-4.4.39-boot2docker.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
md5sum: netfilter-4.4.39-boot2docker.tcz.md5.txt: No such file or directory
Error on netfilter-4.4.39-boot2docker.tcz
docker@default:~$ 

I imagine some boot2docker modification screwed up the filename, because by hand this works fine:

docker@default:~$ tce-load -wi netfilter-4.2.7-tinycore64.tcz
Downloading: netfilter-4.2.7-tinycore64.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
netfilter-4.2.7-tiny 100% |***********************************************************************************|   532k  0:00:00 ETA
netfilter-4.2.7-tinycore64.tcz: OK

and on a vanilla TinyCore ISO installing tcpdump works fine also.

question

Most helpful comment

Update:

Actually I found an easier way to install most packages. You need to modify the tce-load script and replace the following line:

KERNELVER=$(uname -r)

With

KERNELVER="4.2.9-tinycore64"

This will work for version TCE version 7.x. For 8.x it would be:

KERNELVER="4.8.17-tinycore64"

All 7 comments

I found the following workaround to install tcpdump, or any other package that depends on netfiler (of which there are many...)

  1. Install netfilter by hand, e.g. tce-load -i netfilter-4.2.9-tinycore64.tcz
  2. Go to the /tmp/tce/optional/ folder and make a copy or link the netfilter-4.2.9-tinycore64.tcz[.md5.txt] files to netfilter-4.4.39-boot2docker.tcz[.md5.txt]
  3. Go back and install tcpdump or whatever you were trying to in the first place and it should work.

Seems to work well enough to allow tcpdump and openvpn to work, although I haven't tested anything else. Anyway, would be great to get this fixed in boot2docker.

@marius311 : You're workaround works.

Seems like the file "netfilter-4.4.39-boot2docker.tcz" (or "netfilter-4.4.43-boot2docker.tcz" in my case) is not available in http://repo.tinycorelinux.net/7.x/x86/tcz/

@marius311 : good solution. I include a more explanatory version for anyone interested:

```# Attempt to install tcpdump.
tce-load -w -i tcptump.tcz

tcpdump.tcz.dep contains "netfilter-KERNEL" but this package doesnt exist in the repo

Take a note of the missing netfilter file e.g. netfilter-4.4.84-boot2docker.tcz.md5.txt

Identify the version of netfilter already installed

tce-status -i | grep netfilter

e.g. netfilter-4.8.17-tinycore

Get a copy of the install package files for the currently installed net filter and rename it to the version that tcpdump requires

wget -O /tmp/tce/optional/netfilter-4.4.84-boot2docker.tcz http://distro.ibiblio.org/tinycorelinux/8.x/x86/tcz/netfilter-4.8.17-tinycore.tcz
wget -O /tmp/tce/optional/netfilter-4.4.84-boot2docker.tcz.md5.txt http://distro.ibiblio.org/tinycorelinux/8.x/x86/tcz/netfilter-4.8.17-tinycore.tcz.md5.txt

This should allow tcpdump to be loaded

tce-load -w -i tcptump.tcz
```

+1

This is happening with more essential packages like net-bridging or netfilter because of the "boot2docker" versioning which, in my opinion at least, has no real value, keeping it to "tinycore64" or altering tce-load would make all these problems go away

The workaround is very complex, and you would need to be familiar with tinycore to know how to apply it correctly, here you have an example for 8.x, but some may be using 7.x; you also need to know where the tcz files are.

Update:

Actually I found an easier way to install most packages. You need to modify the tce-load script and replace the following line:

KERNELVER=$(uname -r)

With

KERNELVER="4.2.9-tinycore64"

This will work for version TCE version 7.x. For 8.x it would be:

KERNELVER="4.8.17-tinycore64"

@purplesrl's insight worked immediately for me and is significantly easier than marius311's good method, but accomplishes the identical goal.

This should work without quite so much fanfare now given our patch to tce-load:

https://github.com/boot2docker/boot2docker/blob/e02f5fa5fdd4e26adc4b8dbd10b413fbf2c39b76/files/tce-load.patch#L28-L47

That being said, I'd really recommend instead using tcpdump from a container (using tricks like --network=host as necessary).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chantra picture chantra  路  4Comments

DieterRogiest picture DieterRogiest  路  16Comments

KamilKopaczyk picture KamilKopaczyk  路  13Comments

rcross picture rcross  路  6Comments

kianmeng picture kianmeng  路  8Comments