Skip to content
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

updated packer template to install packer onto /dev/sdb1 #18

Open
wants to merge 1 commit into
base: classic
Choose a base branch
from

Conversation

iansmith
Copy link

@YungSang

Not sure if you care about this or not but if you are we can discuss how to merge.

This is not a fully working patch because it doesn't include the packer binaries itself.

If you are running on OS X but want to use packer to build docker images (especially during development) you need to have a copy of packer that can run on linux. The obvious place to put it was inside the boot2docker image so that you can vagrant ssh -c "/mnt/sdb1/packer blah blah blah" when you want to build images. This avoids having two different build schemes one for dev (with Dockerfile) and another for deployment with packer when you want to build EC2 images, etc.

I'm pretty sure a better solution would be to have packer understand the DOCKER_HOST environment variable but I didn't want to take that project on.

Another small problem is that I don't know enough coreos/systemd mojo to figure out how to get the booted vagrant box to automatically mount /dev/sdb1 onto /mnt/sdb1 but you probably know how to do this anyway since you got the original one working correctly for /dev/sda1.

@YungSang
Copy link
Owner

YungSang commented Jan 1, 2015

@iansmith

I've never used Packer to build Docker images, but Vagrant Docker provider/provisioner or Docker itself.

I don't understand well why you need Packer on Linux to build Docker images on OS X.
But boot2docker is eccentric and based on a tiny core linux with 64bit kernel and 32bit user land,
so I think you have to build Go and Packer inside boot2docker.

@YungSang
Copy link
Owner

YungSang commented Jan 1, 2015

Another small problem is that I don't know enough coreos/systemd mojo to figure out how to get the booted vagrant box to automatically mount /dev/sdb1 onto /mnt/sdb1 but you probably know how to do this anyway since you got the original one working correctly for /dev/sda1.

coreos/systemd is not in a case of boot2docker.

@iansmith
Copy link
Author

iansmith commented Jan 1, 2015

Well, packer only builds docker images on Linux (not on OS X) From packer docs: https://packer.io/docs/builders/docker.html

The Docker builder must run on a machine that has Docker installed. Therefore the builder only works on machines that support Docker (modern Linux machines). If you want to use Packer to build Docker containers on another platform, use Vagrant to start a Linux environment, then run Packer within that environment.

Here's my effort at an example:
https://atlas.hashicorp.com/iansmith/boxes/boot2docker-plus-packer

I had assumed you had changed from TinyCore (boot2docker) to CoreOS, my apologies if this is not the case.

@YungSang
Copy link
Owner

YungSang commented Jan 1, 2015

I understand now.
May I suggest that you use CoreOS to do that instead of boot2docker?
I think that my another script seems good for you.
https://github.com/YungSang/coreos-packer

@YungSang
Copy link
Owner

YungSang commented Jan 1, 2015

https://github.com/YungSang/coreos-packer/tree/alpha
Now CoreOS Alpha has Docker v1.4.1.

@YungSang
Copy link
Owner

YungSang commented Jan 1, 2015

You can put any binary in CoreOS as same as docker-enter I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants