Can I use CoreOS rkt
, or some related tool, to run my Docker-Compose project?
And / or is there some way to convert a Docker-Compose project to something similar, for CoreOS and rkt
?
My Docker-Compose project works fine on localhost and on the production servers. But I think I like CoreOS' and rkt's security model better — then I wouldn't have to run the containers with, in effect, root privileges, on my development machine (right?).
Here seems to be docs about how to run a single Docker container with rkt
: https://coreos.com/rkt/docs/latest/running-docker-images.html — but I want Docker-Compose like functionality, not just a single container.
(I currently use an Ubuntu based Linux distro.)
CoreOS rkt (pronounced rocket) is a containerization software engine for running application workloads in isolation from the underlying infrastructure. It is a major competitor to the Docker container engine. CoreOS rkt is based on the Application Container Image (ACI) as defined by the App Container spec (appc).
Kubernetes and Docker Compose are both container orchestration frameworks. Kubernetes runs containers over a number of computers, virtual or real. Docker Compose runs containers on a single host machine.
Compose the file with docker-compose as: docker-compose up -d. Multiple commands to the compose file: command: bash -c "cd app/ && npm start". Multi-line command to compose file: command: > bash -c "cd app/ && npm start".
In a few steps, we'll take you from Docker Compose to Kubernetes. All you need is an existing docker-compose.yml file. Go to the directory containing your docker-compose.yml file.
If you installed Docker Desktop/Toolbox for either Windows or Mac, you already have Docker Compose! Play-with-Docker instances already have Docker Compose installed as well. If you are on a Linux machine, you will need to install Docker Compose.
To convert the docker-compose.yml file to files that you can use with kubectl, run kompose convert and then kubectl apply -f <output file>.
rkt-compose is a lightweight alternative to kubernetes and compose2fleet. rkt-compose supports a subset of the docker-compose file syntax and runs all services of a docker-compose file within a single pod in a wrapped rkt process without dependencies to other tools than rkt and docker (for build). To support service discovery and health checks Consul integration can be enabled optionally.
I have tested the current rkt-compose v0.1.0 release successfully against several of my old docker-compose projects.
Disclosure: I have developed rkt-compose while playing around with rkt and to learn golang.
Security annotation: As in docker rkt containers must also run as root. Running containers as unprivileged user is not supported. I am currently investigating runc: It is also shipped with CoreOS and in its current master state it allows you to truely run a container as unprivileged user with some workarounds and limitations but you still cannot run docker-compose files directly on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With