Files
docker-docs/hack/make/dind-dynbinary
Patrick Devine 878dcb89f3 Make a docker-in-docker dynamic binary and add RPM target
This change adds a new docker-in-docker dynamic binary make target which
builds a centos container for creating the dynamically linked binary.
To use it, you first must create the static binary and then call the
dind-dynbinary target.  You can call it like:

$ hack/make.sh binary dind-dynbinary rpm

This would then package the dynamic binary into the rpm after having
created it in the centos build container.  Unfortunately with this approach
you can't create the rpms and the debs with the same command.  They have to
be created separately otherwise the wrong version (static vs. dynamic) gets
packaged.

Various RPM fixes including:
  - Adding missing RPM dependencies.
  - Add sysconfig configuration files to the RPM.
  - Add an epoch to silence the fpm warning.
  - Remove unnecessary empty package.

Signed-off-by: Patrick Devine <patrick.devine@docker.com>
Signed-off-by: Chad Metcalf <chad@docker.com>
2015-05-05 10:01:39 -07:00

24 lines
618 B
Bash

#!/bin/bash
DEST=$1
DOCKERBIN=$DEST/../binary/docker
BUILDDIR=$DEST/../dynbinary/
RPM_PATH=$DEST/../rpm/
build_rpm() {
if [ ! -x $DOCKERBIN ]; then
echo "No docker binary was found to execute. This step requires 'binary' to be run first."
exit 1
fi
$DOCKERBIN -d 2>/dev/null &
$DOCKERBIN build -t centos-build -f Dockerfile.centos ./
$DOCKERBIN run -it --rm --privileged -v /go:/go -v /usr/local:/usr/local -e "KEEPBUNDLE=true" --name centos-build-container centos-build hack/make.sh dynbinary
# turn off the docker daemon
$DOCKERBIN rmi centos-build
cat /var/run/docker.pid | xargs kill
}
build_rpm