Skip to content

Commit 4f92423

Browse files
docker: Introduce DOCKER_SELINUX variable
1 parent b22e8db commit 4f92423

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

lib/containers/bats.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ sub run_command {
7070
sub configure_docker {
7171
my $docker_opts = "-H unix:///var/run/docker.sock --insecure-registry localhost:5000 --log-level warn";
7272
$docker_opts .= " --experimental" if get_var("DOCKER_EXPERIMENTAL");
73+
# SELinux is not enabled by default due to https://bugzilla.opensuse.org/show_bug.cgi?id=1252290
74+
$docker_opts .= " --selinux-enabled" if get_var("DOCKER_SELINUX");
7375
my $port = 2375;
7476
if (get_var("DOCKER_TLS")) {
7577
$port++;

tests/containers/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The tests rely on some variables:
2020
| variable | description |
2121
| --- | --- |
2222
| `DOCKER_EXPERIMENTAL` | Enable experimental features in Docker |
23+
| `DOCKER_SELINUX` | Enable SELinux in Docker daemon |
2324
| `DOCKER_TLS` | Enable TLS in Docker as documented [here](https://docs.docker.com/engine/security/protect-access/) |
2425
| `GITHUB_PATCHES` | List of github PR id's containing upstream test patches |
2526
| `OCI_RUNTIME` | OCI runtime to use: `runc` or `crun` |

0 commit comments

Comments
 (0)