Giter Club home page Giter Club logo

containerd-workshop's Introduction

containerd-workshop

Containerd basic tutorial using Ubuntu 18.04LTS

Requirements

  • Container = v1.4.0
  • unzip

Steps

Step 1: download containerd sources

Download and set containerd source files

cd ~
mkdir containerd-src
cd containerd-src
wget https://github.com/containerd/containerd/archive/v1.4.0.zip
apt-get install unzip
unzip v1.4.0.zip
wget https://github.com/containerd/containerd/releases/download/v1.4.0/containerd-1.4.0-linux-amd64.tar.gz
tar xvf containerd-1.4.0-linux-amd64.tar.gz

Copy containerd binary files to /user/local/bin

mv bin/* /usr/local/bin

Step 2: create containerd etc and others configurations

create file and directory

mkdir /etc/containerd

Add this content to /etc/containerd/config.toml

subreaper = true
oom_score = -999

[debug]
        level = "debug"

[metrics]
        address = "127.0.0.1:1338"

[plugins.linux]
        runtime = "runc"
        shim_debug = true

copy containerd.service located at containerd-1.4.0 to /etc/systemd/system

cp containerd-1.4.0/containerd.service /etc/systemd/system
chmod 644 /etc/systemd/system/containerd.service
systemctl enable containerd
systemctl start containerd
systemctl status containerd

Step3: Install Golang

Download Golang:

Download and extract sources

wget https://golang.org/dl/go1.15.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.15.linux-amd64.tar.gz

Set enviroment variables and add this to your ~/.profile

mkdir $HOME/go
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
. ~/.profile
mkdir $GOPATH/src

Step4: Installing RunC

Install necesary libraries

apt-get install -y build-essential
apt-get install -y libseccomp-dev
apt-get install -y pkg-config

Compile and install RunC

go get github.com/opencontainers/runc
cd $GOPATH/src/github.com/opencontainers/runc
make
sudo make install

RunC will be installed on:
/usr/local/sbin/runc

Step5: Run Containerd Examples

Install go libreries to compile the example

cd ~
go get github.com/containerd/containerd
go get github.com/containerd/containerd/cio
go get github.com/containerd/containerd/oci
go get github.com/containerd/containerd/namespaces

Then compile it and run it, but first change to the directory where you have the mycontainerd.go file

cd ~
go build mycontainerd.go
./mycontainerd.go

References

Visit these awesome CNCF Projects!

containerd-workshop's People

Contributors

sergioarmgpl avatar

Stargazers

 avatar  avatar

Watchers

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