LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Using docker in Slackware (https://www.linuxquestions.org/questions/slackware-14/using-docker-in-slackware-4175689265/)

RandomTroll 01-26-2021 12:05 AM

Using docker in Slackware
 
I just started trying to use ACRCloud. I began by downloading http://get.docker.com. That returned a script that returns 'Unsupported distribution Slackware' Is there a way to make it work?

3rensho 01-26-2021 12:31 AM

Slackbuilds.org has docker as does Ponce's cache of SlackBuilds for -current.

drgibbon 01-26-2021 02:06 AM

Note that you probably want "docker-cli" too: The "docker" package on SBo only gives the daemon, but you need the cli package to actually use it interactively.

RandomTroll 01-26-2021 10:08 AM

Code:

./containerd/containerd.SlackBuild
returns
Quote:

go build: when using gccgo toolchain, please pass compiler flags using -gccgoflags, not -gcflags
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
go build golang.org/x/net/http/httpguts: no Go files in /usr/src/golang.org/x/net/http/httpguts
go build golang.org/x/net/http2/hpack: no Go files in /usr/src/golang.org/x/net/http2/hpack
go build golang.org/x/net/idna: no Go files in /usr/src/golang.org/x/net/idna
make: *** [Makefile:193: bin/ctr] Error 1
Code:

  docker/docker.SlackBuild
returns
Quote:

Package devmapper was not found in the pkg-config search path.
Perhaps you should add the directory containing `devmapper.pc'
to the PKG_CONFIG_PATH environment variable
No package 'devmapper' found
Removing bundles/

---> Making bundle: dynbinary (in bundles/dynbinary)
Building: bundles/dynbinary-daemon/dockerd-20.10.2
GOOS="" GOARCH="" GOARM=""
build/src/golang.org/x/crypto/nacl/secretbox/secretbox.go:38:2: use of internal package golang.org/x/crypto/internal/subtle not allowed
I can't find a devmapper package in Slackware or on SlackBuilds; is this error fatal?

Later:
I created a devmapper.pc in /usr/local/lib/pkgconfig which got rid of this error.

Even after installing the missing golang packages above I still get the errors.

avian 01-26-2021 12:05 PM

Not precisely sure what the issue is, but looks like you are trying to use the gcc-go toolchain, which I dont believe is sufficient? I've built docker recently using both the google-go-lang SBo (1.13.10), and more recently using the pre-built go package (go1.15.7.linux-amd64.tar.gz from the go website). Had no issues. Just FYI incase you are missing anything else, the dependency's and required packages are below -

Code:

docker-cli
- docker
  - containerd
    - runc
        - google-go-lang
        - libseccoomp
  - tini
  - docker-proxy
    - google-go-lang

Everything is available on SBo, although you could manually bump the versions of the sources.

3rensho 01-26-2021 12:26 PM

When you changed to root for the build did you do " su - " or simply "su" ??? You need su - or GO will go belly up. From your error message that looks like what happened.

RandomTroll 01-26-2021 03:27 PM

Quote:

Originally Posted by avian (Post 6212239)
the dependency's and required packages are below -

Thanks. I installed the complained-about packages and their stated dependencies, which were incomplete, or I misunderstood. I built libseccomp and google-go-lang successfully but when I build runc I get
Code:

runc/runc.SlackBuild
returns:
Quote:

go build "-mod=vendor" "-buildmode=pie" -tags "seccomp" -ldflags "-X main.gitCommit=ff819c7e9184c13b7c2607fe6c30ae19403a7aff -X main.version=1.0.0-rc92 " -o runc .
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
# github.com/opencontainers/runc
/usr/bin/ld: $WORK/b001/_pkg1_.a(_cgo_defun.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: $WORK/b001/_pkg2_.a(_cgo_defun.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:32: runc] Error 2
When I ran as non-root I got a slew of permissions errors, not the same thing; I run all these as root.

ponce 01-26-2021 04:14 PM

please read the README of google-go-lang: after having installed that you have to logout from your root shell and relogin again with "su -" before building the packages that depend on it, like 3rensho told you.
if you don't do that you won't source the filew that it installs in /etc/profile.d and you will keep using the gcc's go compiler, that way the build of runc will fail.

RandomTroll 01-26-2021 04:31 PM

Quote:

Originally Posted by ponce (Post 6212345)
please read the README of google-go-lang: after having installed that you have to logout from your root shell and relogin again with "su -" before building the packages that depend on it, like 3rensho told you.

I never run su; I have a root virtual terminal open all the time. I don't see those instructions in the README.

Quote:

Originally Posted by ponce (Post 6212345)
if you don't do that you won't source the filew that it installs in /etc/profile.d and you will keep using the gcc's go compiler, that way the build of runc will fail.

That's it. I didn't appreciate that I had to log out then back in to pick up the new /etc/profile.d. Thanks.

RandomTroll 01-26-2021 06:44 PM

I built everything, but when I start docker I find this in /var/log/docker.log:
Quote:

panic: cannot statfs cgroup root

goroutine 1 [running]:

github.com/opencontainers/runc/libcontainer/cgroups.IsCgroup2UnifiedMode.func1()
/tmp/SBo/moby-20.10.2/build/src/github.com/opencontainers/runc/libcontainer/cgroups/utils.go:44 +0xc0
sync.(*Once).doSlow(0x55998919bc28, 0x559987e6cfe0)
/usr/lib64/go1.13.10/go/src/sync/once.go:66 +0xe5
sync.(*Once).Do(...)
/usr/lib64/go1.13.10/go/src/sync/once.go:57
github.com/opencontainers/runc/libcontainer/cgroups.IsCgroup2UnifiedMode(0x31)
/tmp/SBo/moby-20.10.2/build/src/github.com/opencontainers/runc/libcontainer/cgroups/utils.go:41 +0x5a
github.com/opencontainers/runc/libcontainer/cgroups.GetCgroupMounts(0x203000, 0x203000, 0x0, 0x0, 0xc0000d2240, 0x16)
/tmp/SBo/moby-20.10.2/build/src/github.com/opencontainers/runc/libcontainer/cgroups/utils.go:62 +0x28
github.com/docker/docker/pkg/sysinfo.findCgroupMountpoints(0x559987de6220, 0xc0000ea3c0, 0x200000003)
/tmp/SBo/moby-20.10.2/build/src/github.com/docker/docker/pkg/sysinfo/sysinfo_linux.go:18 +0x3d
github.com/docker/docker/pkg/sysinfo.New(0xc0009f4000, 0x0, 0x0, 0x0, 0x559987eb8780)
/tmp/SBo/moby-20.10.2/build/src/github.com/docker/docker/pkg/sysinfo/sysinfo_linux.go:67 +0xbf
github.com/docker/docker/daemon.(*Daemon).RawSysInfo(0xc00000c1e0, 0xc0009f4000, 0x0)
/tmp/SBo/moby-20.10.2/build/src/github.com/docker/docker/daemon/daemon_unix.go:1717 +0x96
github.com/docker/docker/daemon.NewDaemon(0x559987f1f7e0, 0xc000a08ac0, 0xc0009f4000, 0xc0009e5b90, 0x0, 0x0, 0x0)
/tmp/SBo/moby-20.10.2/build/src/github.com/docker/docker/daemon/daemon.go:1076 +0x23b1
main.(*DaemonCli).start(0xc0009e4e10, 0xc000222e40, 0x0, 0x0)
/tmp/SBo/moby-20.10.2/build/src/github.com/docker/docker/cmd/dockerd/daemon.go:195 +0x743
main.runDaemon(...)
/tmp/SBo/moby-20.10.2/build/src/github.com/docker/docker/cmd/dockerd/docker_unix.go:13
main.newDaemonCommand.func1(0xc0009f8000, 0xc0009e8ca0, 0x0, 0x2, 0x0, 0x0)
/tmp/SBo/moby-20.10.2/build/src/github.com/docker/docker/cmd/dockerd/docker.go:34 +0x7c
github.com/spf13/cobra.(*Command).execute(0xc0009f8000, 0xc00004e190, 0x2, 0x2, 0xc0009f8000, 0xc00004e190)
/tmp/SBo/moby-20.10.2/build/src/github.com/spf13/cobra/command.go:850 +0x462
github.com/spf13/cobra.(*Command).ExecuteC(0xc0009f8000, 0x0, 0x0, 0x10)
/tmp/SBo/moby-20.10.2/build/src/github.com/spf13/cobra/command.go:958 +0x34b
It looks as though something built looking at the files in /tmp/SBo.

drgibbon 01-26-2021 08:35 PM

Odd, I'm not seeing that on -current with docker from SBo. How did you build it exactly (and how are you starting it?)

RandomTroll 01-26-2021 09:13 PM

I may have built it out of order; I may have not-installed a package after building it; I built some of them without logging out then back in; I built them with gcc-go still installed; I built them without removing the /tmp/SBo files of previous packages - could any of that have caused the problem?

I removed all of them and gcc-go and am now rebuilding them in correct (I hope) order, deleting the previous package's file first.

I run /etc/rc.d/rc.docker start.

Just finished: same result.

drgibbon 01-27-2021 02:27 AM

I don't know, the "/tmp/SBo/" in /var/logs/docker.log is strange though, sounds like some sort of build issue. I just go:
Code:

sboinstall docker-cli
and the logs are normal after `/etc/rc.d/rc.docker start`.

Mobile1 01-27-2021 11:38 AM

I tried compiling SBO Docker, but runc will not causing it to stop / end the process. I've had it running before on a clean install months ago, but it looks like runc was updated since then.

avian 01-27-2021 10:53 PM

Quote:

Originally Posted by Mobile1 (Post 6212656)
I tried compiling SBO Docker, but runc will not causing it to stop / end the process. I've had it running before on a clean install months ago, but it looks like runc was updated since then.

I built docker and the dependencies 4 days ago. Not sure if it will help but below are the versions I used (in the order they were compiled/installed), they seem to work fine together. All via the SBo scripts, just bumped the source versions to the latest where applicable. Using go version 1.15.7.


libseccomp-2.5.1
runc-1.0.0_rc92
containerd-1.4.3
tini-0.19.0
docker-proxy-20210119_448016e
docker-20.10.2
docker-cli-20.10.2


All times are GMT -5. The time now is 04:32 PM.