tree: 57f9c43367487f6944b2fe6c70498f5ad53de607 [path history] [tgz]
  1. src/
  2. BUILD.gn
  3. README.md
src/starnix/tools/convert_tarball_to_starnix_container/README.md

convert_tarball_to_starnix_container

This directory contains a tool to convert images of Linux containers (tar files) into Fuchsia packages that can be run in Starnix.

Creating a package

From a tarball containing the root filesystem

Given a tar file with the contents of the root filesystem:

$ fx host-tool convert_tarball_to_starnix_container --input-format tarball \
    ~/rootfs.tar ~/example.far

From a Docker archive

Build the image as usual, e.g.:

$ docker build -t example .

Save it with docker save:

$ docker save example -o ~/example.tar
$ fx host-tool convert_tarball_to_starnix_container --input-format docker-archive \
    ~/example.tar ~/example.far

Running the container

$ ffx repository publish "$(fx get-build-dir)/amber-files" --package-archive ~/example.far
$ ffx component run --recreate \
    /core/starnix_runner/playground:example \
    fuchsia-pkg://fuchsia.com/example#meta/container.cm

Launch an interactive shell in it:

$ ffx starnix console --moniker /core/starnix_runner/playground:example /bin/sh -i