Skip to content

Commit f2ec540

Browse files
committed
merge #4484 into opencontainers/runc:main
Akihiro Suda (1): docs: remove prompt symbols from shell snippets LGTMs: kolyshkin cyphar
2 parents 4ad9f7f + c8f5d03 commit f2ec540

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

contrib/cmd/memfd-bind/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ but for most users the security benefit is identical.
2424
The provided `[email protected]` file can be used to get systemd to manage
2525
this daemon. You can supply the path like so:
2626

27-
```
28-
% systemctl start memfd-bind@$(systemd-escape -p /usr/bin/runc)
27+
```bash
28+
systemctl start memfd-bind@$(systemd-escape -p /usr/bin/runc)
2929
```
3030

3131
Thus, there are three ways of protecting against CVE-2019-5736, in order of how

docs/cgroup-v2.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ The recommended systemd version is 244 or later. Older systemd does not support
3434

3535
Make sure you also have the `dbus-user-session` (Debian/Ubuntu) or `dbus-daemon` (CentOS/Fedora) package installed, and that `dbus` is running. On Debian-flavored distros, this can be accomplished like so:
3636

37-
```console
38-
$ sudo apt install -y dbus-user-session
39-
$ systemctl --user start dbus
37+
```bash
38+
sudo apt install -y dbus-user-session
39+
systemctl --user start dbus
4040
```
4141

4242
## Rootless
4343
On cgroup v2 hosts, rootless runc can talk to systemd to get cgroup permissions to be delegated.
4444

45-
```console
46-
$ runc spec --rootless
47-
$ jq '.linux.cgroupsPath="user.slice:runc:foo"' config.json | sponge config.json
48-
$ runc --systemd-cgroup run foo
45+
```bash
46+
runc spec --rootless
47+
jq '.linux.cgroupsPath="user.slice:runc:foo"' config.json | sponge config.json
48+
runc --systemd-cgroup run foo
4949
```
5050

5151
The container processes are executed in a cgroup like `/user.slice/user-$(id -u).slice/user@$(id -u).service/user.slice/runc-foo.scope`.
@@ -60,11 +60,11 @@ memory pids
6060

6161
To allow delegation of other controllers, you need to change the systemd configuration as follows:
6262

63-
```console
64-
# mkdir -p /etc/systemd/system/[email protected]
65-
# cat > /etc/systemd/system/[email protected]/delegate.conf << EOF
63+
```bash
64+
sudo mkdir -p /etc/systemd/system/[email protected]
65+
cat <<EOF | sudo tee /etc/systemd/system/[email protected]/delegate.conf
6666
[Service]
6767
Delegate=cpu cpuset io memory pids
6868
EOF
69-
# systemctl daemon-reload
69+
sudo systemctl daemon-reload
7070
```

docs/terminals.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ descriptors to preserve. Instead, it takes how many file descriptors (not
3535
including `stdio` or `LISTEN_FDS`) should be passed to the container. In the
3636
following example:
3737

38-
```
39-
% runc run --preserve-fds 5 <container>
38+
```bash
39+
runc run --preserve-fds 5 <container>
4040
```
4141

4242
`runc` will pass the first `5` file descriptors (`3`, `4`, `5`, `6`, and `7` --
@@ -46,8 +46,8 @@ In addition to `--preserve-fds`, `LISTEN_FDS` file descriptors are passed
4646
automatically to allow for `systemd`-style socket activation. To extend the
4747
above example:
4848

49-
```
50-
% LISTEN_PID=$pid_of_runc LISTEN_FDS=3 runc run --preserve-fds 5 <container>
49+
```bash
50+
LISTEN_PID=$pid_of_runc LISTEN_FDS=3 runc run --preserve-fds 5 <container>
5151
```
5252

5353
`runc` will now pass the first `8` file descriptors (and it will also pass
@@ -136,8 +136,8 @@ not a terminal (some `ssh` implementations only look for a terminal on stdin).
136136

137137
Another way is to run runc under the `script` utility, like this
138138

139-
```console
140-
$ script -e -c 'runc run <container>'
139+
```bash
140+
script -e -c 'runc run <container>'
141141
```
142142

143143
[tty_ioctl(4)]: https://linux.die.net/man/4/tty_ioctl
@@ -150,8 +150,8 @@ the contained process (this is not necessarily the same as `--preserve-fds`'s
150150
passing of file descriptors -- [details below](#runc-modes)). As an example
151151
(assuming that `terminal: false` is set in `config.json`):
152152

153-
```
154-
% echo input | runc run some_container > /tmp/log.out 2> /tmp/log.err
153+
```bash
154+
echo input | runc run some_container > /tmp/log.out 2> /tmp/log.err
155155
```
156156

157157
Here the container's various `stdio` file descriptors will be substituted with

tests/integration/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@ framework.
1515
## Running integration tests
1616

1717
The easiest way to run integration tests is with Docker:
18-
```
19-
$ make integration
18+
```bash
19+
make integration
2020
```
2121
Alternatively, you can run integration tests directly on your host through make:
22-
```
23-
$ sudo make localintegration
22+
```bash
23+
sudo make localintegration
2424
```
2525
Or you can just run them directly using bats
26-
```
27-
$ sudo bats tests/integration
26+
```bash
27+
sudo bats tests/integration
2828
```
2929
To run a single test bucket:
30-
```
31-
$ make integration TESTPATH="/checkpoint.bats"
30+
```bash
31+
make integration TESTPATH="/checkpoint.bats"
3232
```
3333

3434

3535
To run them on your host, you need to set up a development environment plus
3636
[bats (Bash Automated Testing System)](https://github.com/bats-core/bats-core#installing-bats-from-source).
3737

3838
For example:
39-
```
40-
$ cd ~/go/src/github.com
41-
$ git clone https://github.com/bats-core/bats-core.git
42-
$ cd bats-core
43-
$ ./install.sh /usr/local
39+
```bash
40+
cd ~/go/src/github.com
41+
git clone https://github.com/bats-core/bats-core.git
42+
cd bats-core
43+
./install.sh /usr/local
4444
```
4545

4646
> **Note**: There are known issues running the integration tests using

0 commit comments

Comments
 (0)