Skip to content

Commit

Permalink
Update Docker.md
Browse files Browse the repository at this point in the history
  • Loading branch information
agievich committed Apr 7, 2023
1 parent 74b5710 commit d3571e1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
53 changes: 34 additions & 19 deletions Docker.md
Original file line number Diff line number Diff line change
@@ -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"
```

0 comments on commit d3571e1

Please sign in to comment.