Re: Converting a Docker container to a Runc container -> Read-only file system

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

 



On 2019-02-21, Philip Rhoades <phil@xxxxxxxxxxxxx> wrote:
> People,
> 
> I have exported an existing container with:

This isn't the right list for this -- I would suggest mailing
<dev@xxxxxxxxxxxxxxxxxx>. This is a kernel mailing list -- but I'll
answer your question anyway.

>   mkdir rootfs
>   docker export rails_dsf | tar -C rootfs -xvf -
>   runc spec
>   runc run rails_dsf

Check whether "readonly": true is in config.json, and set it to false if
it is.

I would recommend using skopeo and umoci for generating an OCI runtime
bundle, since those are more modern. The equivalent to the above command
would be:

  $ # You need an image to operate on.
  % id="$(docker commit rails_dsf rails_img)"

  # Convert the Docker image to an OCI image.
  % skopeo copy docker-daemon:rails_img:latest oci:rails_img:latest

  # Unpack the image into an OCI runtime bundle.
  % umoci unpack --image rails_img:latest bundle

  # Run the bundle with runc.
  % runc run -b bundle rails_dsf

(The nice thing is that you can then generate new layers if you want
using OCI -- as well as taking advantage of rootless containers if you
use the --rootless flag to umoci.)

-- 
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux