Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I run/convert a Docker-Compose project with/to CoreOS rkt?

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.)

like image 576
KajMagnus Avatar asked Jul 27 '16 06:07

KajMagnus


People also ask

What is CoreOS RKT?

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).

Is Docker compose similar to Kubernetes?

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.

How to compose the file with docker-compose?

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".

How to migrate from Docker Compose to Kubernetes?

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.

Do I need to install Docker Compose on a Linux machine?

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.

How to convert Docker-Compose to kubectl?

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>.


1 Answers

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.

like image 146
mxg Avatar answered Sep 20 '22 17:09

mxg