-
Notifications
You must be signed in to change notification settings - Fork 237
Add the option to use docker containers #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,5 @@ base* | |
| sigs | ||
| target-bin/bootstrap-fixup | ||
| .vagrant | ||
| docker | ||
| *.Dockerfile | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ ARCH=amd64 | |
| MIRROR_BASE=http://${MIRROR_HOST:-127.0.0.1}:3142 | ||
| LXC=0 | ||
| VBOX=0 | ||
| DOCKER=0 | ||
|
|
||
| usage() { | ||
| echo "Usage: ${0##*/} [OPTION]..." | ||
|
|
@@ -19,6 +20,7 @@ usage() { | |
| --arch A build architecture A (e.g. i386) instead of amd64 | ||
| --lxc use lxc instead of kvm | ||
| --vbox use VirtualBox instead of kvm | ||
| --docker use docker instead of kvm | ||
|
|
||
| The MIRROR_HOST environment variable can be used to change the | ||
| apt-cacher host. It should be something that both the host and the | ||
|
|
@@ -70,6 +72,10 @@ if [ $# != 0 ] ; then | |
| VBOX=1 | ||
| shift 1 | ||
| ;; | ||
| --docker) | ||
| DOCKER=1 | ||
| shift 1 | ||
| ;; | ||
| --*) | ||
| echo "unrecognized option $1" | ||
| exit 1 | ||
|
|
@@ -153,6 +159,32 @@ fi | |
| # Remove cron to work around vmbuilder issue when umounting /dev on target | ||
| removepkg=cron | ||
|
|
||
| if [ $DOCKER = "1" ]; then | ||
|
|
||
| addpkg=`echo $addpkg | tr ',' ' '` | ||
|
|
||
| mkdir -p docker | ||
| cd docker | ||
|
|
||
| # Generate the dockerfile | ||
| cat << EOF > $OUT.Dockerfile | ||
| FROM $DISTRO:$SUITE | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| RUN apt-get update && apt-get --no-install-recommends -y install $addpkg | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense to run a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should keep the base vm image as close to what lxc and kvm modes would generate. AFAICT, they don't do dist-upgrade either. |
||
|
|
||
| RUN useradd -ms /bin/bash -U $DISTRO | ||
| USER $DISTRO:$DISTRO | ||
| WORKDIR /home/$DISTRO | ||
|
|
||
| CMD ["sleep", "infinity"] | ||
| EOF | ||
|
|
||
| docker build --pull -f $OUT.Dockerfile -t $OUT . | ||
|
|
||
| exit 0 | ||
| fi | ||
|
|
||
| if [ $VBOX = "1" ]; then | ||
| NAME="$SUITE-$ARCH" | ||
| if ! vagrant status | grep "$NAME" | grep "not created" > /dev/null; then | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have a default value set on top of this script (like LXC and KVM). This later makes
$DOCKER = "1"fail when not using docker.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed