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

[atomic-devel] atomic-reactor and building in a container



quote from https://github.com/projectatomic/atomic-reactor

> Features: build inside a docker container (so your builds are separated between each other)

I was consulting with upstream docker and found they have a milestone to separate builder outside of docker, ie "docker build" at some point would an external app would build an image and pass it to docker daemon to load it or push it docker registry 

they recently introduced CP api that allow docker client to copy files between containers/host

https://docs.docker.com/reference/commandline/cp/

one of those builders is dockramp

https://github.com/jlhawn/dockramp

and there we are discussing how to do something similar to atomic-reactor, but using extended Dockerfiles only

we are discussing a way to pivot/switch containers root in away similar to rpm's spec-file, the docker file is a usual dockerfile that starts with a build image (or stock image followed by yum install gcc golang ...)
then do the build then switch the root to a minimal/base image (without compiler) that is sufficient to run it, with something like this

RUN make install SERVER_PREFIX=/dest/server CLIENT_PREFIX=/dest/client
RUN cp /bin/server-extra /dest/server/bin/
RUN cp /bin/server-replicator /dest/replicator/bin/
RUN cp /bin/client-extra /dest/client/bin/
SWITCH_ROOT busybox /dest/server
TAGGED_SWITCH_ROOT client busybox /dest/client
TAGGED_SWITCH_ROOT replicator busybox /dest/replicator

it would build 3 images: foobar, foobar-client, foobar-replicator



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