LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Testing Docker 1.12.0 on Slackware 14.2? (https://www.linuxquestions.org/questions/slackware-14/testing-docker-1-12-0-on-slackware-14-2-a-4175587202/)

Pratt 08-16-2016 11:29 AM

Testing Docker 1.12.0 on Slackware 14.2?
 
Hello friends,

I've been tryng to build docker 1.12.0 on slackware 14.2 for some time now, but I have been unable to create a functional package.

I wanted to know If someone here has had experience using docker 1.12.0 on slackware? I knwo that on slackbuilds.org I can find version 1.8.2, however I want to try a newer version.

I know I need to have containerd, godep and runc, so I have written some slackbuilds. However, the service doesnt run (docker daemon)

Docker.SlackBuid
Code:

#!/bin/sh
# Slackware build script for docker

PRGNAM=docker
GITHASH="8eab29e"
VERSION=${VERSION:-1.12.0}
DOCKERCOMPOSE_VERSION=${DOCKERCOMPOSE_VERSION:-1.8.0}
CONTAINERD_VERSION=${CONTAINERD_VERSION:-0.0.5}
BUILD=${BUILD:-1}
TAG=${TAG:-_mpratt}
DOCKER_URL="https://github.com/docker/docker/archive/v${VERSION}.tar.gz"

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/mpratt}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION

if [[ "${VERSION}" == "current" ]]; then
    git clone https://github.com/docker/docker.git
    VERSION=$(cat docker/VERSION)
    mv docker $PRGNAM-$VERSION
else
    wget -c ${DOCKER_URL} -O $CWD/v${VERSION}.tar.gz
    tar xvf $CWD/v${VERSION}.tar.gz
fi

cd $PRGNAM-$VERSION
chown -R root:root .

# the have symlinks in their testdata that goes outside the context of this build
find . ! -type l \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o ! -type l \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

unset GOPATH

# Patch
# patch -p1 < ${CWD}/patches/shim.patch

mkdir -p ${PKG}/usr/share/gocode/src/github.com/docker/docker
cp -a .  ${PKG}/usr/share/gocode/src/github.com/docker/docker/

AUTO_GOPATH=1 DOCKER_GITCOMMIT="$GITHASH" ./hack/make.sh dynbinary
#./man/md2man-all.sh  (requires go-md2man)

install -Dm755 "bundles/${VERSION}/dynbinary-client/docker-${VERSION}" "${PKG}/usr/bin/docker"
install -Dm755 "bundles/${VERSION}/dynbinary-daemon/docker-proxy-${VERSION}" "${PKG}/usr/bin/docker-proxy"
install -Dm755 "bundles/${VERSION}/dynbinary-daemon/dockerd-${VERSION}" "${PKG}/usr/bin/dockerd"

# completion
install -Dm644 'contrib/completion/bash/docker' "${PKG}/usr/share/bash-completion/completions/docker"
install -Dm644 'contrib/completion/zsh/_docker' "${PKG}/usr/share/zsh/site-functions/_docker"
install -Dm644 'contrib/completion/fish/docker.fish' "${PKG}/usr/share/fish/vendor_completions.d/docker.fish"

# vim syntax
install -Dm644 'contrib/syntax/vim/syntax/dockerfile.vim' "${PKG}/usr/share/vim/vimfiles/syntax/dockerfile.vim"
install -Dm644 'contrib/syntax/vim/ftdetect/dockerfile.vim' "${PKG}/usr/share/vim/vimfiles/ftdetect/dockerfile.vim"
# man
#install -dm755 "${PKG}/usr/share/man"
#mv man/man* "${PKG}/usr/share/man"

install -D --mode 0644 $CWD/config/docker.default $PKG/etc/default/docker.new
install -D --mode 0644 $CWD/config/docker.logrotate $PKG/etc/logrotate.d/docker.new
install -D --mode 0755 $CWD/config/rc.docker $PKG/etc/rc.d/rc.docker.new

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS CONTRIBUTING.md CHANGELOG.md LICENSE README.md NOTICE VERSION $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-dev/dev/g')-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

containerd.SlackBuild
Code:

#!/bin/sh
# Slackware build script for containerd


PRGNAM=containerd
VERSION=${VERSION:-0.2.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_mpratt}

#Download Url
CONTAINERD_URL="https://github.com/docker/containerd/archive/v${VERSION}.tar.gz"

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/mpratt}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION

wget -c ${CONTAINERD_URL} -O $CWD/v${VERSION}.tar.gz
tar xvf $CWD/v${VERSION}.tar.gz

cd $PRGNAM-$VERSION

chown -R root:root .
# the have symlinks in their testdata that goes outside the context of this build
find . ! -type l \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o ! -type l \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

unset GOPATH
export GOPATH="${TMP}/${PRGNAM}-${VERSION}"
mkdir -p src/github.com/docker
cd src/github.com/docker/
ln -rsf "${TMP}/${PRGNAM}-${VERSION}" containerd
cd containerd
LDFLAGS= make

cd src/github.com/docker/containerd/bin
for file in $(find . -type f -print); do
    echo ${file}
    install -Dm755 ${file} ${PKG}/usr/bin/${file}
    file=$(echo ${file} | sed 's/\.\///g')
    if [[ "${file}" == "ctr" ]]; then
        ln -s ${file} ${PKG}/usr/bin/docker-containerd-${file}
    else
        ln -s ${file} ${PKG}/usr/bin/docker-${file}
    fi
done

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

runc.SlackBuild
Code:

#!/bin/sh
# Slackware build script for runc

PRGNAM=runc
VERSION=${VERSION:-1.0.0-rc1}
BUILDVERSION=${BUILDVERSION:-1.0.0rc1}
BUILD=${BUILD:-1}
TAG=${TAG:-_mpratt}

#Download Url
RUNC_URL="https://github.com/opencontainers/runc/archive/v${VERSION}.tar.gz"

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/mpratt}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION

wget -c ${RUNC_URL} -O $CWD/v${VERSION}.tar.gz
tar xvf $CWD/v${VERSION}.tar.gz

cd $PRGNAM-$VERSION
mkdir -p Godeps/_workspace/src/github.com/opencontainers
ln -sfT ${TMP}/${PRGNAM}-${VERSION} Godeps/_workspace/src/github.com/opencontainers/runc

chown -R root:root .
# the have symlinks in their testdata that goes outside the context of this build
find . ! -type l \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o ! -type l \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

unset GOPATH

${CWD}/godep go build -o runc .
install -Dm755 runc ${PKG}/usr/bin/runc
ln -s runc ${PKG}/usr/bin/docker-runc

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$BUILDVERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

docker-compose.SlackBuild
Code:

#!/bin/sh
# Slackware build script for docker-compose

PRGNAM="docker-compose"
VERSION=${VERSION:-1.5.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_mpratt}

# Download Urls
DOCKERCOMPOSE_URL="https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m)"

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/mpratt}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
mkdir -p ${PKG}/usr/bin/
cd $TMP

# Install Docker Compose
curl -L ${DOCKERCOMPOSE_URL} > ${PKG}/usr/bin/docker-compose
chmod 755 ${PKG}/usr/bin/docker-compose
chown root:root ${PKG}/usr/bin/docker-compose
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-dev/dev/g')-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}

Has anyone had experience working with a newer version of docker on slackware 14.2?

Any pointers would be greatly appreciated!

lazardo 08-16-2016 10:07 PM

https://slackbuilds.org/repository/14.2/system/docker/

Richard Cranium 08-16-2016 10:09 PM

Quote:

Originally Posted by lazardo (Post 5591917)

Did you even read the OP's post? (I've certainly posted first and read second a few times, myself.)

lazardo 08-17-2016 03:20 PM

Quote:

Originally Posted by Richard Cranium (Post 5591919)
Did you even read the OP's post? (I've certainly posted first and read second a few times, myself.)

Strangely I did, keyed on that OP stated that build scripts were self-written vs from slackbuilds.org.

I'll read it again just in case.

[ rereads original post ]

I stand by my reply

Cheers,

Richard Cranium 08-17-2016 03:34 PM

Quote:

Originally Posted by lazardo (Post 5592282)
Strangely I did, keyed on that OP stated that build scripts were self-written vs from slackbuilds.org.

I'll read it again just in case.

[ rereads original post ]

I stand by my reply

Cheers,

From the OP's post:

Quote:

I knwo that on slackbuilds.org I can find version 1.8.2, however I want to try a newer version.
Providing the OP a link to something that he/she already knows about is not very helpful.

Pratt 08-17-2016 08:28 PM

Hi guys,

Thanks for your replies. Yes Indeed I know that slackbuilds.org has a version of docker, however recent versions of docker seems to have added new requirements, for example, in order to build version 1.12.0 you have at least two more dependencies, containerd, runc and even godep.

So I wrote the slackbuilds based on the one in slackbuilds.org (I posted them on my first message) and they Indeed compile succesfully and build a slackware package. However its not really a functional one, I have issues for example running the daemon (rc.docker).

So I just wanted to know if someone here running slackware 14.2 has had any experience building or using docker 1.12.0 before, in order to find any pointers on why my package doesnt work, fix the issue and submit the code to slackbuilds.org so that people interested can work with a newer version. Docker 1.8.2 was released on 2015-09-10 and on the other hand 1.12.0 was released like one month ago.

Im all for keeping it simple and stable, no need to be on the bleeding edge, however I would really like to use a newer docker version on slackware, it might help my workflow and I have been bitten by some bugs on the older version of docker that the new version doesnt have.

Pratt 08-20-2016 02:08 AM

I figured it out.

For the people interested I have the slackbuilds in https://github.com/mpratt/environmen...kbuilds/docker

It can definately be tweaked and the daemon uses the overflow engine by default.

It works for me, I'll be looking into cleaning up the build process (I have to build a proper godep package) before submitting it to slackbuilds.org or whatever, it doesn't seem to be many people interested on it.

ponce 08-20-2016 02:20 AM

Hi Michael,

consider that docker on SBo is maintained by another person so, if you wish to have it updated there, you should do it through him.

Pratt 08-20-2016 10:36 AM

Sure Ponce, no problem!

Once I have everything all clean and nice, I will make sure to contact vbatts so that he can review everything and upload it to slackbuilds.org.

Slack-Lars 08-27-2016 01:53 PM

Hi Pratt,

thank you very much for these scripts. I haven't been able to build a newer version than the one on Slackbuilds.
when I use your scripts from GitHub and try to build containerd it fails with the following error:

Quote:

mkdir -p bin/
cd ctr && go build -ldflags "-X github.com/docker/containerd.GitCommit= " -o ../bin/ctr
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
cd containerd && go build -ldflags "-X github.com/docker/containerd.GitCommit= " -tags "" -o ../bin/containerd
../runtime/process.go:16:2: C source files not allowed when not using cgo: gccgo_c.c
Makefile:49: recipe for target 'daemon' failed
make: *** [daemon] Error 1
I'm building on slackware-current and use the versions you point to in the .info files.
I use google-go-lang version 1.6.3

Any idea where this comes from ?

Lars

Edit:
Mmmh... Fixed it...
Ponce said in this post:
Quote:

- installed google-go-lang from SBo (it has some files in /etc/profile.d that must be loaded so after installing it you have to logout/reboot);
So, I logged out and in, rebuild and it now works perfectly !

Richard Cranium 11-08-2016 07:46 PM

Quote:

Originally Posted by Pratt (Post 5593558)
Sure Ponce, no problem!

Once I have everything all clean and nice, I will make sure to contact vbatts so that he can review everything and upload it to slackbuilds.org.

I just used your scripts from GitHub and everything built just fine!

I can even use docker-compose (which requires a curl command to install, but that's OK).

hotchili 12-06-2016 04:05 PM

Hey,

I used your slackbuilds and they worked fine.
There was only one problem, somehow I had to do:
Code:

. /etc/profile.d/go.sh
first, else it would try to build stuff with gcc-go which was not working ;)

bassmadrigal 12-06-2016 04:10 PM

Quote:

Originally Posted by hotchili (Post 5638855)
Hey,

I used your slackbuilds and they worked fine.
There was only one problem, somehow I had to do:
Code:

. /etc/profile.d/go.sh
first, else it would try to build stuff with gcc-go which was not working ;)

Anything that installs something to /etc/profile.d/ will either need to be sourced (as you did here) or require a logout/login to run those scripts.


All times are GMT -5. The time now is 06:03 PM.