diff --git a/AUTHORS.md b/AUTHORS.md index d8c1fb14..1acf3519 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -41,7 +41,7 @@ Contributors* - Uladzimir Palukha - code review - Mikhail Mitskevich - - build scripts, Github Actions + - build scripts, Github Actions, Docker - license issues - Alexander Zhirkevich - cmd/sig, cmd/rng, cmd/test diff --git a/Docker.md b/Docker.md index 47b954ab..0264a6e5 100644 --- a/Docker.md +++ b/Docker.md @@ -1,56 +1,71 @@ -# Install Docker -We need Docker with multi-platform image support. Plugin `buildx` is included by default to `docker-desktop`, and available for `docker-ce` and `moby-engine`. +# Running Bee2 within Docker containers -Debian: +## Install Docker + +We need Docker with support for multi-platform images. This support is provided +by the `buildx` plugin included by default in `docker-desktop` and available +from `docker-ce` and `moby-engine`. + +Install on Debian: ``` apt install moby-engine moby-buildx moby-compose moby-cli ``` -Ubuntu: -https://docs.docker.com/engine/install/ubuntu/ -# Prepare Docker to work with multi-platform images +Install on Ubuntu: +[https://docs.docker.com/engine/install/ubuntu/](https://docs.docker.com/engine/install/ubuntu/). + +## Prepare Docker + First time: + ``` docker buildx create --name mybuilder docker buildx use mybuilder ``` -Each time: + +Next times: ``` docker run --privileged --rm tonistiigi/binfmt --install all ``` -# Update images for build +## Update Docker images + ``` docker buildx bake debian docker buildx bake fedora ``` -# Run build and test on the all available platforms +## Build and test Bee2 on all available platforms + ``` docker buildx bake --progress="plain" bee2d docker buildx bake --progress="plain" bee2f ``` -# Run build and test on a one of available platforms +## Build and test Bee2 on a specific platform + ``` docker buildx build --platform linux/amd64 --progress="plain" -f dockerfiles/bee2d.Dockerfile . docker buildx build --platform linux/amd64 --progress="plain" -f dockerfiles/bee2f.Dockerfile . ``` -# Run terminal on specified platform image +## Run a terminal on a specific platform + ``` docker run --rm -it -v .:/usr/src --platform linux/s390x btls/fedora:cdev bash ``` -### Turn on experimental features -If option `platform` is unavailable in Docker, you need turn on experimental Docker CLI features in one of two ways. Either by setting an environment variable +## Enable experimental Docker features + +The `platform` option may not be available in Docker. In this case you need +to enable experimental Docker CLI features in one of two ways: + +* set the environment variable `DOCKER_CLI_EXPERIMENTAL` to `enabled`: ``` -$ export DOCKER_CLI_EXPERIMENTAL=enabled +export DOCKER_CLI_EXPERIMENTAL=enabled ``` -or by turning the feature on in the config file $HOME/.docker/config.json: + +* add the following line to the config file `$HOME/.docker/config.json`: ``` -{ - … - "experimental" : "enabled" -} +"experimental" : "enabled" ``` \ No newline at end of file