----- Original Message -----
From: "Amit Saha" <asaha(a)redhat.com>
To: "Beaker development" <beaker-devel(a)lists.fedorahosted.org>
Sent: Monday, December 15, 2014 5:14:55 PM
Subject: [Beaker-devel] Docker based workflow for working on restraint
In case you don't want a few additional packages on your system, here is a
script which will build a docker image installing all dependencies needed to
run restraint's tests:
The real value is of course being able to work on your code base on Fedora 20, Fedora 21,
Cent OS 6, etc using this script to build the relevant image with all the dependencies
installed.
#!/bin/bash
# ./restraint.sh <image_name> <docker_base_image>
uid=`id -u`
user=`id -un`
cat <<EOF > Dockerfile
FROM $2
RUN yum -y install make glib2 glib2-devel glibc-devel libarchive-devel
libsoup-devel gcc pkgconfig gettext libselinux-devel openssl-devel
perl-XML-Parser selinux-policy-devel zlib-devel git git-daemon tar thttpd
RUN yum -y install emacs-nox
RUN useradd -u $uid $user
USER $uid
EOF
docker build -t $1 .
mv Dockerfile Dockerfile.$1
echo "$1 created. Entering: /home/$user"
docker run -v /home/$user:/home/$user -ti $1 bash
Assuming you have docker setup:
./restraint.sh fedora21_restraint fedora:21
Will build the docker image and also start the container:
Successfully built a8f0f98cb2f2
fedora21_restraint created. Entering: /home/asaha
Couple of things are worth noting:
1. It creates a user of the same username, uid and gid of the user you
execute docker as
2. Assuming you are *not* using docker as root/sudo, this means, an user of
the same uid/gid is created in
the container. Hence, since /home/$user is volume mounted, you should have
r+w access to your host's
home directory (only if you turn off selinux or may be set it to permissive).
If you have a clone of restraint already in your home, you can directly start
working on it, or just clone it
and run "make check".
You will need
http://gerrit.beaker-project.org/#/c/3869/ for all the tests to
pass.
--
Amit Saha
SED, Hosted & Shared Services
Red Hat, Inc.
_______________________________________________
Beaker-devel mailing list
Beaker-devel(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/beaker-devel
--
Amit Saha
SED, Hosted & Shared Services
Red Hat, Inc.