How to install docker

You have a problem with Salix? Post here and we'll do what we can to help.
mMontu
Posts: 22
Joined: 1. Jan 2017, 23:52
Location: Brazil

How to install docker

Post by mMontu »

I've used docker 1.12.0 for a while in Salix, but today I found it wasn't working anymore.
So I tried to reinstall it, but then I found that the repo I used the last time was removed (https://github.com/mpratt/environment-c ... lds/docker -- mentioned in https://www.linuxquestions.org/question ... 175587202/).

Then I tried to install the old version using spi, but it fails:

Code: Select all

spi -i docker
---> Making bundle: dynbinary (in bundles/17.09.0-ce/dynbinary)
Building: bundles/17.09.0-ce/dynbinary-daemon/dockerd-17.09.0-ce
../../build/src/github.com/docker/docker/daemon/logger/gcplogs/gcplogging.go:11:2: cannot find package "cloud.google.com/go/compute/metadata" in any of:
        /usr/src/cloud.google.com/go/compute/metadata (from $GOROOT)
        /usr/src/slapt-src/system/docker/docker-ce-17.09.0-ce/build/src/cloud.google.com/go/compute/metadata (from $GOPATH)
../../build/src/github.com/docker/docker/daemon/logger/gcplogs/gcplogging.go:12:2: cannot find package "cloud.google.com/go/logging" in any of:
        /usr/src/cloud.google.com/go/logging (from $GOROOT)
        /usr/src/slapt-src/system/docker/docker-ce-17.09.0-ce/build/src/cloud.google.com/go/logging (from $GOPATH)
../../build/src/github.com/docker/docker/cmd/dockerd/daemon.go:4:2: cannot find package "context" in any of:
        /usr/src/context (from $GOROOT)
        /usr/src/slapt-src/system/docker/docker-ce-17.09.0-ce/build/src/context (from $GOPATH)

(...)

        /usr/src/slapt-src/system/docker/docker-ce-17.09.0-ce/build/src/google.golang.org/grpc/grpclog (from $GOPATH)
../../build/src/github.com/docker/docker/libcontainerd/remote_unix.go:30:2: cannot find package "google.golang.org/grpc/health/grpc_health_v1" in any of:
        /usr/src/google.golang.org/grpc/health/grpc_health_v1 (from $GOROOT)
        /usr/src/slapt-src/system/docker/docker-ce-17.09.0-ce/build/src/google.golang.org/grpc/health/grpc_health_v1 (from $GOPATH)
../../build/src/github.com/docker/docker/libcontainerd/remote_unix.go:31:2: cannot find package "google.golang.org/grpc/transport" in any of:
        /usr/src/google.golang.org/grpc/transport (from $GOROOT)
        /usr/src/slapt-src/system/docker/docker-ce-17.09.0-ce/build/src/google.golang.org/grpc/transport (from $GOPATH)
fakeroot -- sh docker.SlackBuild Failed
I've reinstalled the go-lang dependeny, but nothing changed:

Code: Select all

spi -i google-go-lang
I found a report of a similar problem (https://www.linuxquestions.org/question ... 175616167/) and the solution is this:
I would try:
- removing google-go-lang from your system;
- rebuild and reinstall google-go-lang from SBo;
- logout from root;
- relogin as root or become root with "su -" (note the space and the dash after the su command);
- from the just opened root shell build and install from SBo in this order: tini, docker-proxy, libseccomp, runc, containerd and docker.
these steps worked fine on a slackware64-14.2 full and up-to-date installation.
But those slackbuilds doesn't show in slapt-src, and installing them manually is cumbersome, so I intended to update my slapt-srcrc. But I found that it is not recomended (viewtopic.php?f=12&t=6880&p=43088&hilit ... crc#p43088):
No. Definitely do not do that. You should not add the slackbuilds.org source, unless you really know what you're doing.
So, any ideas on how should I proceed? Is there an easier way to install a recent docker version?
Thanks in advance
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: How to install docker

Post by mimosa »

Cumbersome though it may be, a manual approach is all that is really open to you; however, I wouldn't advise blindly following some complex suggestion found on the net. Have a look at slackbuilds.org for any advice about dependencies you may be missing, try building it from the latest stable source (edit the build script to reflect the version number), and see what error messages you get.

This process can actually be quite fun, and if you get stuck, please ask for advice here. Make sure you take careful notes of exactly what you did. When you are successful, if you have time, you could post them here for the benefit of other users.

However, it is possible someone else has already done it and can give you some specific hints.

EDIT
libseccomp is, in fact, in the repositories, and docker-proxy, tini, runc, and containerd are available as slackbuilds, so you should be able to try that suggestion at LQ. If you're not seeing them, then you have messed up your sources in slapt-getrc and slapt-srcrc.
mMontu
Posts: 22
Joined: 1. Jan 2017, 23:52
Location: Brazil

Re: How to install docker

Post by mMontu »

Thanks mimosa, I don't know why I couldn't find those earlier; slapt-src is missing only google-go-lang and libseccomp, indeed.

I followed your suggestion and executed the procedure:

- downloaded and installed the Slackbuild for google-go-lang manually
- reboot
- slapt-src -i tini
- slapt-src -i docker-proxy
- downloaded and installed the Slackbuild for libseccomp manually
- slapt-src -i runc

I stopped here as runc installation failed:

Code: Select all

runc-3f2f8b84a77f73d38244dd690525642a72156c64/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go
go build -i  -ldflags "-X main.gitCommit=3f2f8b84a77f73d38244dd690525642a72156c64 -X main.version=1.0.0-rc4+dev " -tags "seccomp" -o runc .
build/src/github.com/opencontainers/runc/libcontainer/configs/namespaces_syscall.go:5:8: C source files not allowed when not using cgo: gccgo_c.c
Makefile:28: recipe for target 'runc' failed
make: *** [runc] Error 1
fakeroot -- sh runc.SlackBuild Failed
Any ideas? A quick search on google (https://www.mail-archive.com/search?l=s ... newest&f=1) recommends logout/login, but I've performed a reboot at that point.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: How to install docker

Post by mimosa »

Having had a look around, I'm afraid I'm stumped too. I can see three lines of enquiry:

1) some old stuff left lying around. Perhaps you could try building it in a chroot install (or a fresh install in a VM)

2) incompatible versions - in particular, maybe gcc-go 5.3.0 is too old. It may be it would work in current

3) https://slackbuilds.org/repository/14.2 ... e-go-lang/
I couldn't make much sense of this, but note what it says about slackbuilds towards the bottom

I tried building golang 1.8.5 (the version currently on offer at slackbuilds.org) and building runc against that, but no dice.

Sorry not to be of more help.
User avatar
laprjns
Salix Warrior
Posts: 1105
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: How to install docker

Post by laprjns »

I tried installing docker on a fresh Salix install on VirtualBox using spi (ie sudo spi -i docker). On a fresh install doing a simulation (-s) install of docker I got the following package that it wants to install

Code: Select all

rich[~]$ spi -i -s docker
The following packages will be installed:
   gcc-go google-go-lang libseccomp 
The following SlackBuilds will be installed:
   containerd docker docker-proxy runc tini 
So I moved forward and attempted to install docker using:

Code: Select all

rich[~]$ sudo spi -i docker

It installed gcc-go, google-go-lang and libseccomp with out problems. Note that these are binary packages prebuilt from Slackbuild. It then attempted to build runc and resulted in the same build failure as you got. runc is built using the Go program language which is why google-go-lang was a dependency in this install. Reading the google-go-lang README file it indicates that there needs to be some environment variables (specifically GOPATH) set before using it. To do this, either log out then log back in or do the following to set the variable:

Code: Select all

sudo source /etc/profile.d/go.sh
Once this was done, I ran spi -i docker again and this time runc built and installed without problems. It then went on and built and installed containered and docker-proxy but failed building tini because of cmake not being installed. cmake is a common dependency and most likely is already installed on a systems that have had other packages already installed (@gapan -Apparently the tini dependencies file need to have cmake added to it). Installing cmake will bring in several other dependencies and once they were installed, tini was built and installed without problem.

So at this point I finally got to building docker which then also failed with the following build error.

Code: Select all

docker-ce-17.09.0-ce/components/packaging/rpm/gen-rpm-ver
docker-ce-17.09.0-ce/components/packaging/rpm/systemd/
docker-ce-17.09.0-ce/components/packaging/rpm/systemd/docker.service
docker-ce-17.09.0-ce/components/packaging/static/
docker-ce-17.09.0-ce/components/packaging/static/Makefile
docker-ce-17.09.0-ce/components/packaging/static/hash_files
# WARNING! I don't seem to be running in a Docker container.
# The result of this command might be an incorrect build, and will not be
# officially supported.
#
# Try this instead: make all
#

---> Making bundle: dynbinary (in bundles/17.09.0-ce/dynbinary)
Building: bundles/17.09.0-ce/dynbinary-daemon/dockerd-17.09.0-ce
# github.com/docker/docker/api/server/router/debug
../../build/src/github.com/docker/docker/api/server/router/debug/debug.go:27: undefined: expvar.Handler
fakeroot -- sh docker.SlackBuild Failed
And that where I stand with this, I have googled "debug.go:27: undefined: expvar.Handler", which appears to have to do with the Go programming language, but haven't come up with anything obvious that would fix this yet. I did manage to kick this can down the road a bit, maybe someone with more knowledge of Go can pick it up from here.
“Don’t you see that the whole aim of Newspeak is to narrow the range of thought?"
mMontu
Posts: 22
Joined: 1. Jan 2017, 23:52
Location: Brazil

Re: How to install docker

Post by mMontu »

Thanks @mimosa and @laprjns!

mimosa, as far as I understand laprjns has tried your suggestions 1 and 3. So the only missing part is suggestion 2), upgrading gcc-go. If I understood correctly gcc must be updated in order to update gcc-go, and I found the following comment on a LQ post:
https://www.linuxquestions.org/question ... cc-468595/
The problem is not only the version of gcc that is installed, but the version the programs of your system ( mainly your kernel in the case of a driver) was compiled with. So after you havew installed the newer version of gcc ( which should be able with the packagemanagment of slackware) you need to recompile your kernel and change the gcc-version in the /etc/make.conf file
So I guess that updating gcc may break the system, or at least require recompiling several stuff (including the kernel, which I believe is beyond my current knowledge). Is there an ISO of Salix which already contains a newer version of GCC? It could be used to test in a fresh install in a VM.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: How to install docker

Post by mimosa »

Try Slackel (which is based on Slackware current):
http://www.slackel.gr/

However, I wouldn't discount the value of chipping away at the other avenues. This looks like a tough nut to crack, but it is surely doable.
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: How to install docker

Post by gapan »

I just added packages for docker + deps in the x86_64 extra repos. As soon as mirrors sync, you should be able to get them with:

Code: Select all

sudo spi -i docker
Image
Image
mMontu
Posts: 22
Joined: 1. Jan 2017, 23:52
Location: Brazil

Re: How to install docker

Post by mMontu »

Great, thanks!!
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: How to install docker

Post by mimosa »

Hats off to you gapan!

Do you still need to do this:

https://slackbuilds.org/repository/14.2/system/docker/
To use docker as a limited user, add your user to the 'docker' group:

# groupadd -r -g 281 docker
# usermod -a -G docker <your_username>

This will require logging out and back in and also restarting docker
daemon.

To have the docker daemon start and stop with your host,
add to /etc/rc.d/rc.local:

if [ -x /etc/rc.d/rc.docker ]; then
/etc/rc.d/rc.docker start
fi

and to /etc/rc.d/rc.local_shutdown (creating it if needed):

if [ -x /etc/rc.d/rc.docker ]; then
/etc/rc.d/rc.docker stop
fi
Post Reply