This is the 31st day of my participation in the August Text Challenge.More challenges in August

🌲 preface

CBL stands for Common Base Linux, and Mariner aims to serve as an internal Linux distribution for Microsoft engineering teams to build cloud infrastructure and edge products and services.

☀ ️ introduction

Mariner is open source and has its own repository under Microsoft’s GitHub organization. No ISO or image of Mariner is currently available and you need to compile it yourself, but REPo has instructions for building them on Ubuntu 18.04.

At the end of the bo editor translated good ISO file, you can directly download the installation experience!

The GitHub page lists a list of prerequisites, roughly including Docker, RPM tools, ISO build tools, and Golang.

Official source: github.com/pc-study/CB…

🍉 Compile the CBL image file

❤️ next, we will compile a local image file to play!

Preparing for the Compilation Environment

Ubuntu 18.04 is recommended for compilation.

Vagrant installs Ubuntu 18.04

Since you need to build on Ubuntu 18.04, you quickly create a virtual machine environment using Vagrant native.

mkdir -p /Volumes/DBA/vagrant/ubuntu1804
cd /Volumes/DBA/vagrant/ubuntu1804
vagrant init generic/ubuntu1804
vagrant up --provider=virtualbox
Copy the code

Connect to the host and change the password

vagrant ssh
sudo passwd root
su - root
Copy the code

Prerequisites

Add a Backports repository to install the latest version of Go:

sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
Copy the code

1. Dependencies required for installation:

Sudo apt-y install make tar wget curl RPM qemu-utils Golang-1.15-go genisoimage python-minimal bison Gawk partedCopy the code

2. Installation is recommendedpigz, but not required, for faster compression operations:

sudo apt -y install pigz
Copy the code

3, fix go 1.15 link:

Sudo ln -vsf /usr/lib/go-1.15/bin/go /usr/bin/goCopy the code

4, Install docker:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
Copy the code

After the configuration, you are advised to shut down the host:

vagrant halt
Copy the code

Download the CBL-Mariner project

As the official source was too slow, I forked to my Gitee repository: gitee.com/luciferlpc/… .

git clone https://gitee.com/luciferlpc/CBL-Mariner.git
Copy the code

After downloading it locally, upload it to the server host:

Edit the Vagrantfile file and mount the current directory to the host/Vagrant directory:

Restart Ubuntu host:

cd /Volumes/DBA/vagrant/ubuntu1804
vagrant up
Copy the code

Or upload through FTP and other tools!

Sync to the latest stable version:

1.0 stable git checkoutCopy the code

Copy the file to /opt:

cp -r /vagrant/CBL-Mariner /opt
Copy the code

Build a VHD or VHDX image

📢 Note: There is a small problem with parsing and GO:

Fixed:

export GO111MODULE=on
export GOPROXY=https://goproxy.io
echo '47.246.43.224 goproxy. Cn' >>/etc/hosts
echo '140.82.121.3 github.com' >>/etc/hosts
echo 'the nameserver 8.8.8.8' >>/etc/resolv.conf
echo 'the nameserver 8.8.4.4' >>/etc/resolv.conf
Copy the code

Build a VHDX image

Mirror placed on.. / out/images/core – efi:

cd toolkit
sudo make image REBUILD_TOOLS=y REBUILD_PACKAGES=n CONFIG_FILE=./imageconfigs/core-efi.json
Copy the code

Build process, there may be a domain name cannot resolve the problem, you can visit: packages.microsoft.com/cbl-mariner… The RPM package.

After waiting a long, long time, to finish:

Build a VHD image

Mirror placed on.. / out/images/core – legacy:

cd toolkit
sudo make image REBUILD_TOOLS=y REBUILD_PACKAGES=n CONFIG_FILE=./imageconfigs/core-legacy.json
Copy the code

Build the cloud-init configuration image

Mirror placed on.. /out/images/meta-user-data.iso

cd toolkit
sudo make meta-user-data
Copy the code

Create and access a host

Create a VHD(X) VM using VirtualBox.

1. Create a host

2. Select the compiled VHD(X) file

3. Mount the meta-user-data. Iso image

4. Start and log in to the VM

Account Password:

mariner_user/p@ssw0rd
Copy the code

In general, Linux commands are pretty much the same.

Building an ISO Image

Mirror placed on.. /out/images/full

cd toolkit
sudo make iso REBUILD_TOOLS=y REBUILD_PACKAGES=n CONFIG_FILE=./imageconfigs/full.json
Copy the code

The generated ISO image is less than 700 MB.

Install the system using an ISO image

Terminal Mode Installation

1, create a host:

All the following options are default.

2. Mount the ISO image generated above:

3. Start the host and install:

Select installation mode: divided into terminal and graphical, this time select terminal installation.

Choose full installation:

Select the system installation disk:

Skip disk encryption:

Set host name:

Creating a user and password: The password rules must meet high requirements.

Start installation:

Restart after installation:

Installation in graphical mode

1, create a host:

All the following options are default.

2. Mount the ISO image generated above:

3. Start the host and install:

Select installation mode: The installation mode can be terminal or graphical.

Choose full installation:

Choose to accept agreement:

Unencrypted disk:

Create user password:

Start installation:

Restart after installation:

Connect after restart:

⭐️ At this point, CBL-Mariner has been successfully installed and experienced!

❄️ is at the end

If you do not want to compile ISO image of your friends, you can directly download my compiled image installation experience!

❤️ can scan code to pay attention to my public number, menu bar from! ❤ ️


This is the end of sharing ~

If you think the article is helpful to you, please like it, favorites it, pay attention to it, comment on it, and support it four times with one button. Your support is the biggest motivation for my creation.

❤️ technical exchange can follow the public number: Lucifer think twice before you do ❤️