git-lfs/docker
2015-07-23 23:18:36 -04:00
..
git-lfs_centos_5 First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
git-lfs_centos_6 First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
git-lfs_centos_7 First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
git-lfs_debian_7 First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
git-lfs_debian_8 First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
git-lfs-full-build_centos_5 Centos full builds work 2015-07-23 23:18:35 -04:00
git-lfs-full-build_centos_6 Centos full builds work 2015-07-23 23:18:35 -04:00
git-lfs-full-build_centos_7 Centos full builds work 2015-07-23 23:18:35 -04:00
git-lfs-test_centos_7 Added Repo Tests 2015-07-23 23:18:36 -04:00
git-lfs-test_debian_8 Added Repo Tests 2015-07-23 23:18:36 -04:00
build_dockers.bsh First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
centos_script.bsh First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
debian_script.bsh First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
distributions Got Debian signing packages 2015-07-23 23:18:36 -04:00
dpkg-package-gpg.bsh First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
preload_key.bsh First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
public.key Need blank public.key at least 2015-07-23 23:18:36 -04:00
README.md First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
rpm_sign.exp First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
run_dockers.bsh First draft of GPG signing working in CentOS 2015-07-23 23:18:36 -04:00
test_dockers.bsh Added Repo Tests 2015-07-23 23:18:36 -04:00
test_lfs.bsh Added Repo Tests 2015-07-23 23:18:36 -04:00

README

Document DOCKER_CMD

TL;DR version

  1. Run the dockers

     ./docker/run_dockers.bsh
    
  2. ???

  3. Enjoy all your new package files in

     ./docker/repos/
    

##Using the Dockers##

Building Dockers (Optional)

run_dockers.bsh now call build_dockers build_dockers.bsh, but you can still call the script manually to get it all out of the way once while you go make that tea/coffee.

In order to use the docker images, they have to be built so that they are ready to be used. For OSes like Debian, this is a fairly quick process. However CentOS takes considerably longer time, since it has to build go, ruby, or git from source, depending on the version. Fortunately, you can build the docker images JUST once, and you won't have to build it again (unless something significant changes, which should be fairly uncommon). This means all the compiling, yum/apt-get/custom dependency compiling is done once and saved. (This is done in CentOS by using the already existing ./rpm/rpm_build.bsh script to bootstrap the image and saving the image.)

There is a script to take care of ALL of these details for you. Simply run

./docker/build_dockers.bsh

And all the git-lfs_* images will be built automatically. These are all a developer would need to test the different OSes.

If you were more interested in creating all the special packages for CentOS (For example, you may want to hand out the git rpm for CentOS 6, since only git 1.7.1 is available, or else everyone will have to build git from source just to use git-lfs on CentOS 6), then the git-lfs-full-build_* dockers are useful. Instead of building everyone necessary into the image, these contain bare CentOS image, so the ./rpm/rpm_build.bsh script will build all of its dependencies when you run the dockers, making the rpms available. These images can be build by running

./docker/docker_build.bsh ./docker/git-lfs-full-build_*

In fact, any subset of images can be built only, by passing the list of of directories as argument. (Each directory contains a Dockerfile, this is used to tell the .bsh scripts which you want to work on AND names them in docker images based on the directory name.)

(To manually build a docker, run docker build -t $(basename ${DockerDir}) -f ${DockerDir}/Dockerfile ./docker

Running Dockers

After the docker images are build, a lot of arguments need to me added to get the mount points right, etc... again, a convenient script is supplied to make this all easy. By running

./docker/run_docker.bsh

All the git-lfs_* images build their packages and tranfer them to the ./docker/repos directory.

Copies your current source Cleans the copies, so all untracked files are deleted, but uncommited changes are kept

###Development with Dockers###

##Deploying/Building Repositories##

Setting the website URL

GPG signing

gpg --key-gen

public.key

signing.key

GPG agent ttl set to 5 hours, should be plenty to build everything.

Testing the Repositories

./test_dockers.bsh

Adding addition OSes

To add another operating system, simply follow the already existing pattern, and all the script will them them up. A new Dockerfile should go in a directory named

./docker/git-lfs_{OS NAME}_{OS VERSION}

where {OS NAME} and {OS VERSION} should not contain underscores (_). Any files that need to be added to the docker image can be dropped in the ./docker directory, since that is the root they are built against (not the directory containing the Dockerfile)

The docker image should write it's repo files to /repo inside the docker, and they will end up in

./docker/repos/{OS NAME}/{OS VERSION}/

Docker Cheat sheet

http://docs.docker.com/ Install -> Docker Engine -> Installation on ...

  • list running dockers

    docker ps

  • list stopped dockers

    docker ps -a

  • Remove all stopped dockers

    docker rm $(docker ps --filter=status=exited -q)

  1. How much space are all these Dockers taking up?

    No idea. sudo du /var/lib/docker

Troubleshooting

  1. I started one of the script, and am trying to stop it with Ctrl+C. It is ignoring many Ctrl+C's

    This happens a lot when calling programs like apt-get, yum, etc... From the host, you can still use ps, pgrep, kill, pkill, etc... commands to kill the PIDs in a docker.

  2. How do I re-enter a docker after it failed/suceeded?

    Dockers are immediately deleted upon exit. The best way to work in a docker is to run bash. This will let you to run the main build command and then continue.

  3. That answer's not good enough. How do I resume a docker?

    Well, first you have to remove the --rm flag. This will keep the docker around after stopping. Be careful! They multiply like rabbits. Then

     ```docker commit {container name/id} {new_name}```
    

    Then you can docker run that new image.