Code Monkey home page Code Monkey logo

cube-hello's Introduction

# This is an example of how to construct an OS container from the
# binaries in dom0 using meta-overc technology.

# Here instructions to run the example which you can cut and paste
# after you have logged into your target system

cube-console dom0

# Get the container creation script below or
### Optionally doing it this way instead:
###   git clone https://github.com/WindRiver-OpenSourceLabs/cube-hello
###   cd cube-hello

wget https://raw.githubusercontent.com/WindRiver-OpenSourceLabs/cube-hello/master/mk-cube-hello.sh


# Create the OS container as a tar.bz2 file
sh mk-cube-hello.sh

# Register and install the new container
cube-ctl add cube-hello.tar.bz2

# At this point you will probably have to sign into the dom0 again
# because it restarts cube-cmd-server, unless you ssh'ed into dom0
cube-console dom0

# Snapshot the container so as to restore it later
/opt/overc-system-agent/overc container snapshot cube-hello dom0

# You can see the snapshot with the following
/opt/overc-system-agent/overc container list_snapshots cube-hello dom0

# Start the container
cube-ctl start cube-hello


# Login to the cube-hello container and damage it!
cube-console cube-hello
#### cube-hello login:
root
#### HelloWorld bash OS Container#
ls /
### bin  etc  lib64  opt    proc  run   sys  usr
### dev  lib  mnt    pam.d  root  sbin  tmp
### HelloWorld bash OS Container#
rm -rf /* 2> /dev/null 
### HelloWorld bash OS Container#
ls /
### -sh: ls: command not found
### HelloWorld bash OS Container#
exit

# Stop the container
cube-ctl stop cube-hello
# Roll back the container
/opt/overc-system-agent/overc container rollback cube-hello dom0
# See the snapshot is gone
/opt/overc-system-agent/overc container list_snapshots cube-hello dom0
# Create a new snapshot for a future rollback
/opt/overc-system-agent/overc container snapshot cube-hello dom0


# Start the container and see it is restored
cube-ctl start cube-hello
cube-console cube-hello
#### cube-hello login:
root
#### HelloWorld bash OS Container#
ls /
### bin  etc  lib64  opt    proc  run   sys  usr
### dev  lib  mnt    pam.d  root  sbin  tmp
### HelloWorld bash OS Container#
exit

# Now the cube-hello container can be deleted from the system

cube-ctl del cube-hello

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.