From 42b57cc730e6283b5f64563e90a7201d47d9a354 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 10 Aug 2021 09:27:50 +0200 Subject: [PATCH] BUILDING.md: markdown fixes - correct language-hints on code-fences - fix duplicate titles, causing non-unique anchors Signed-off-by: Sebastiaan van Stijn --- BUILDING.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index e275f1078..0fe9a95ab 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -32,9 +32,9 @@ git clone https://github.com/containerd/containerd For proper results, install the `protoc` release into `/usr/local` on your build system. For example, the following commands will download and install the 3.11.4 release for a 64-bit Linux host: -``` -$ wget -c https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip -$ sudo unzip protoc-3.11.4-linux-x86_64.zip -d /usr/local +```sh +wget -c https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip +sudo unzip protoc-3.11.4-linux-x86_64.zip -d /usr/local ``` `containerd` uses [Btrfs](https://en.wikipedia.org/wiki/Btrfs) it means that you @@ -77,7 +77,7 @@ best results. `containerd` uses `make` to create a repeatable build flow. It means that you can run: -``` +```sh cd containerd make ``` @@ -86,7 +86,7 @@ This is going to build all the project binaries in the `./bin/` directory. You can move them in your global path, `/usr/local/bin` with: -```sudo +```sh sudo make install ``` @@ -99,7 +99,7 @@ Note: if you set one of these vars, set them to the same values on all make stag If you want to prepend an additional prefix on actual installation (eg. packaging or chroot install), you can pass it via `DESTDIR` variable: -```sudo +```sh sudo make install DESTDIR=/tmp/install-x973234/ ``` @@ -112,7 +112,7 @@ Older releases was using `DESTDIR` for a different purpose that is similar to `P When making any changes to the gRPC API, you can use the installed `protoc` compiler to regenerate the API generated code packages with: -```sudo +```sh make generate ``` @@ -139,7 +139,7 @@ Please refer to [RUNC.md](/docs/RUNC.md) for the currently supported version of You can build static binaries by providing a few variables to `make`: -```sudo +```sh make EXTRA_FLAGS="-buildmode pie" \ EXTRA_LDFLAGS='-linkmode external -extldflags "-fno-PIC -static"' \ BUILDTAGS="netgo osusergo static_build" @@ -153,12 +153,12 @@ make EXTRA_FLAGS="-buildmode pie" \ The following instructions assume you are at the parent directory of containerd source directory. -## Build containerd +## Build containerd in a container You can build `containerd` via a Linux-based Docker container. You can build an image from this `Dockerfile`: -``` +```dockerfile FROM golang RUN apt-get update && \ @@ -180,10 +180,11 @@ This mounts `containerd` repository You are now ready to [build](#build-containerd): ```sh - make && make install +make && make install ``` -## Build containerd and runc +## Build containerd and runc in a container + To have complete core container runtime, you will need both `containerd` and `runc`. It is possible to build both of these via Docker container. You can use `git` to checkout `runc`: @@ -199,7 +200,6 @@ FROM golang RUN apt-get update && \ apt-get install -y libbtrfs-dev libseccomp-dev - ``` In our Docker container we will build `runc` build, which includes @@ -268,6 +268,7 @@ go test -v -run . -test.root ``` Example output from directly running `go test` to execute the `TestContainerList` test: + ```sh sudo go test -v -run "TestContainerList" . -test.root INFO[0000] running tests against containerd revision=f2ae8a020a985a8d9862c9eb5ab66902c2888361 version=v1.0.0-beta.2-49-gf2ae8a0