LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-16-2016, 11:29 AM   #1
Pratt
Member
 
Registered: Apr 2005
Location: Colombia
Distribution: Slackware 14.2
Posts: 82

Rep: Reputation: 18
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!

Last edited by Pratt; 08-17-2016 at 08:30 PM. Reason: Updated docker.Slackbuild
 
Old 08-16-2016, 10:07 PM   #2
lazardo
Member
 
Registered: Feb 2010
Location: SD Bay Area
Posts: 270

Rep: Reputation: Disabled
https://slackbuilds.org/repository/14.2/system/docker/
 
Old 08-16-2016, 10:09 PM   #3
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by lazardo View Post
Did you even read the OP's post? (I've certainly posted first and read second a few times, myself.)
 
Old 08-17-2016, 03:20 PM   #4
lazardo
Member
 
Registered: Feb 2010
Location: SD Bay Area
Posts: 270

Rep: Reputation: Disabled
Quote:
Originally Posted by Richard Cranium View Post
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,

Last edited by lazardo; 08-17-2016 at 03:22 PM.
 
Old 08-17-2016, 03:34 PM   #5
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by lazardo View Post
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.
 
Old 08-17-2016, 08:28 PM   #6
Pratt
Member
 
Registered: Apr 2005
Location: Colombia
Distribution: Slackware 14.2
Posts: 82

Original Poster
Rep: Reputation: 18
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.
 
1 members found this post helpful.
Old 08-20-2016, 02:08 AM   #7
Pratt
Member
 
Registered: Apr 2005
Location: Colombia
Distribution: Slackware 14.2
Posts: 82

Original Poster
Rep: Reputation: 18
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.

Last edited by Pratt; 08-25-2016 at 07:11 PM. Reason: updated the url
 
2 members found this post helpful.
Old 08-20-2016, 02:20 AM   #8
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,090

Rep: Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173
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.
 
Old 08-20-2016, 10:36 AM   #9
Pratt
Member
 
Registered: Apr 2005
Location: Colombia
Distribution: Slackware 14.2
Posts: 82

Original Poster
Rep: Reputation: 18
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.
 
Old 08-27-2016, 01:53 PM   #10
Slack-Lars
LQ Newbie
 
Registered: Jun 2006
Distribution: Slackware Current
Posts: 16

Rep: Reputation: 1
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 !

Last edited by Slack-Lars; 08-27-2016 at 02:13 PM. Reason: Solved problem
 
Old 11-08-2016, 07:46 PM   #11
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Pratt View Post
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).
 
Old 12-06-2016, 04:05 PM   #12
hotchili
Member
 
Registered: Sep 2009
Location: Germany
Distribution: slackware64-current
Posts: 89

Rep: Reputation: 32
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
 
Old 12-06-2016, 04:10 PM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by hotchili View Post
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.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Automate Web Application Testing With Docker and Travis LXer Syndicated Linux News 0 06-10-2016 01:08 AM
LXer: Docker Part 4: building and publishing custom docker images LXer Syndicated Linux News 0 04-08-2016 01:30 PM
LXer: Docker Engine 1.6 Debuts Alongside Docker Registry 2.0 and Compose 1.2.0 LXer Syndicated Linux News 0 04-17-2015 09:02 PM
LXer: Testing the most recent Nova-Docker driver on Ubuntu 14.04 in devstack environment recoverable LXer Syndicated Linux News 0 02-17-2015 08:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration