Create Dockerfile #255

Merged
merged 3 commits into from Apr 3, 2016

Projects

None yet

3 participants

@faddat
Contributor
faddat commented Apr 2, 2016

It's a file that will allow lib to run outside of its happy native debian environment, for example, on arch, or in fact... anywhere. That should actually do it, that single line. I can make it more complicated if need be, but I think that will work..... wait wait wait, have to do something about the path relativity, so..... I had it clone the repository anyway instead of just using the files that Docker will automatically copy over. May want to put this in igorpekovnik/docker to maximum cleanliness, but the idea here is that the docker image will be updated each time your repo is. It should be usable like this:

docker run -P igorpekovnik/lib ./compile.sh
@faddat faddat Create Dockerfile
It's a file that will allow lib to run outside of its happy native debian environment, for example, on arch, or in fact... anywhere.  That should actually do it, that single line.  I can make it more complicated if need be, but I think that will work..... wait wait wait, have to do something about the path relativity, so..... I had it clone the repository anyway instead of just using the files that Docker will automatically copy over.  May want to put this in igorpekovnik/docker to maximum cleanliness, but the idea here is that the docker image will be updated each time your repo is.  It should be usable like this:  docker run igorpekovnik/lib ./compile.sh
715d68f
@faddat
Contributor
faddat commented Apr 2, 2016

BTW: Untested, and made the pull request because I've done this many times before. I am doing some testing now that includes the build automation, and will let you know the results.

@zador-blood-stained
Collaborator

Image creation needs access to loop devices, so it will require running docker in privileged mode (if I understand its documentation correctly)

@faddat
Contributor
faddat commented Apr 3, 2016

Thank you! I'll get that added. I may try using something like wercker to deal with the image build automation so that it isn't as ugly as it is at the moment.

faddat added some commits Apr 3, 2016
@faddat faddat Merge pull request #1 from igorpecovnik/master
rebasing
8567aec
@faddat faddat Made the dockerfile actually work.
Build:
docker build --name lib .

Invocation:
docker run lib --privileged -it -P
e590f2f
@faddat
Contributor
faddat commented Apr 3, 2016

Dockerfile now works, going to do a vagrantfile, too, because why not?

@igorpecovnik
Owner

Well, let's try.

@igorpecovnik igorpecovnik merged commit 9381c4b into igorpecovnik:master Apr 3, 2016
@faddat
Contributor
faddat commented Apr 3, 2016

The next step in using this is for you or another (if there are any) of the repository's owners to go to hub.docker.com and then login, click "create automated build" in the upper-right hand corner, and then select the repository. This will make it so that a new docker image will be created each time the code for lib is updated :).

@faddat
Contributor
faddat commented Apr 3, 2016

Can also look into using something like wercker to create a more complex build chain. Here's how to use it before making the automated build:

sudo docker build -t lib .
sudo docker run -it -P --privileged lib /root/compile.sh

If you want to use this Docker image on ARM (not supported @ docker hub for automated builds) just change the first line:

FROM ubuntu

to

FROM armv7/armhf-ubuntu

Once this image is added as an automated build, you'll be able to run it like this:

sudo docker run -it -P --privileged igorpecovnik/lib /root/compile.sh

Note: I haven't come up with an awesome way to pull the output out of the docker image. I may add some volumes so that it's easier. For now you can use docker copy, etc....

@faddat
Contributor
faddat commented Apr 3, 2016

Note: Looking for feedback on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment