Code Monkey home page Code Monkey logo

oci2aci's Introduction

oci2aci - Convert OCI bundle to ACI

oci2aci is a small library and CLI binary that converts OCI bundle to ACI. It takes OCI bundle as input, and gets ACI image as output.

oci2aci's workflow divided into two steps:

  • Convert. Convert oci layout to aci layout.
  • Build. Build aci layout to .aci image.

An OCI layout described as below:

config.json
runtime.json
rootfs/

An ACI layout described as below:

manifest
rootfs/

Build

Installation is simple as:

go get github.com/huawei-openlab/oci2aci

or as involved as:

git clone https://github.com/huawei-openlab/oci2aci.git
cd oci2aci
make

Usage

$ oci2aci
NAME:
   oci2aci - Tool for conversion from oci to aci

USAGE:
   oci2aci [--debug] [arguments...]

VERSION:
   0.1.0

FLAGS:
   -debug=false: Enables debug messages

You can use oci2aci as a CLI tool directly to convert a oci-bundle to aci image, furthermore, you can use oci2aci as a external function in your program by importing package "github.com/huawei-openlab/oci2aci/convert"

Example

Examples of oci2aci illustrated as below:

// An example of invalid oci bundle
$ oci2aci  --debug test
2015/09/28 09:46:05 test: invalid oci bundle: error accessing bundle: stat test: no such file or directory
2015/09/28 09:46:05 Conversion stop.

// An example of valid oci bundle
$ oci2aci  --debug example/oci-bundle
2015/09/28 09:42:14 example/oci-bundle/: valid oci bundle
2015/09/28 09:42:14 Manifest:/tmp/oci2aci796486541/manifest generated successfully.
2015/09/28 09:42:14 Image:/tmp/oci2aci796486541.aci generated successfully.

$ actool --debug validate /tmp/oci2aci796486541.aci
/tmp/oci2aci796486541.aci: valid app container image

$ rkt run /tmp/oci2aci796486541.aci --insecure-skip-verify --mds-register=false --volume proc,kind=host,source=/bin --volume dev,kind=host,source=/bin --volume devpts,kind=host,source=/bin --volume shm,kind=host,source=/bin --volume mqueue,kind=host,source=/bin --volume sysfs,kind=host,source=/bin --volume cgroup,kind=host,source=/bin
2015/09/28 09:45:26 Preparing stage1
2015/09/28 09:45:26 Writing image manifest
2015/09/28 09:45:26 Loading image sha512-ed1404273ed6ab8e8c7a323b994e8ce6e24d0dd5b17d2480021d52cdc87de8f1
2015/09/28 09:45:26 Writing pod manifest
2015/09/28 09:45:26 Setting up stage1
2015/09/28 09:45:26 Wrote filesystem to /var/lib/rkt/pods/run/fc9d66c6-4c49-4a14-94d6-3d8215521dd2
2015/09/28 09:45:26 Pivoting to filesystem /var/lib/rkt/pods/run/fc9d66c6-4c49-4a14-94d6-3d8215521dd2
2015/09/28 09:45:26 Execing /init
[1016397.575456] example[4]: Do something in advance for the rkt container......Done!
[1016397.579740] example[6]: Hello, I am running in the rkt container......
[1016397.581921] example[8]: Clean the resource for the rkt container......Done!

oci2aci's People

Contributors

chengtiesheng avatar

Watchers

James Cloos avatar pengzhouhu avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.