[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[atomic-devel] ostree-docker-builder


I was experimenting for fun with creating Docker images using rpm-ostree
instead of "docker build".  rpm-ostree already supports it, and it can
be specified in the .json file setting the "container" flag to true.
The generated tree can be tarred and imported directly into Docker.

I wrote a small program to simplify the generation of the image,
available on github:


The commands below, for example, will be enough to generate an Emacs

$ cat emacs.json
    "ref": "fedora-atomic/f22/x86_64/emacs",  
    "repos": ["fedora-22"],  
    "container": true,  
    "packages": ["emacs"]  

$ sudo rpm-ostree --repo=repo compose tree emacs.json
$ sudo ostree-docker-builder --repo=repo -c emacs fedora-atomic/f22/x86_64/emacs --entrypoint=/usr/bin/emacs-24.5

ostree-docker-builder also supports pushing the image to the registry if
something has changed (thanks to Colin for suggesting this!), it uses a
Docker LABEL to remember the OStree commit used to generate to image.

The two advantages of using it are:

- The same tool to generate the OS image and the containers.
- Use OStree to track what files were changed, added or removed.  If there are no differences then no image is created.

Any comments?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]