Skip to content

Commit b09da84

Browse files
committed
Fix DevContainer
1 parent 12eb6ed commit b09da84

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

.devcontainer/test/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
FROM registry.suse.com/bci/golang:1.21
5+
FROM --platform=linux/amd64 opensuse/leap:15.6
66

7-
RUN zypper -n install git make curl gcc podman systemd && zypper clean -a
7+
RUN zypper -n install curl git tar gzip make gcc podman systemd systemd-sysvcompat
8+
9+
# Install Go and Ginkgo
10+
RUN curl -LO https://go.dev/dl/go1.21.13.linux-amd64.tar.gz
11+
RUN tar -C /usr/local -xzf go1.21.13.linux-amd64.tar.gz
12+
ENV PATH="/usr/local/go/bin:$PATH"
813
RUN go install github.com/onsi/ginkgo/v2/ginkgo@v2.20.1
914

10-
ENV PATH="/root/go/bin:$PATH"
1115
WORKDIR /workspace
1216

13-
# Indicate to systemd that it's running inside a container.
14-
# This prevents systemd from trying to start all host services.
15-
ENV container docker
16-
1717
# /usr/sbin/init is the standard path for the systemd executable acting as init.
1818
CMD ["/usr/sbin/init"]

.devcontainer/test/devcontainer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44
{
55
"name": "uyuni-tools-devcontainer-e2e-tests",
66
"build": { "dockerfile": "Dockerfile" },
7+
"runArgs": [
8+
"--privileged",
9+
"--tmpfs /tmp",
10+
"--tmpfs /run",
11+
"--cap-add=SYS_ADMIN",
12+
"--cap-add=AUDIT_WRITE",
13+
"--cap-add=AUDIT_CONTROL",
14+
"--cgroupns=host",
15+
"--volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
16+
],
17+
"init": true,
18+
"securityOpt": [ "seccomp=unconfined" ], // needed for systemd
19+
"containerEnv": {
20+
"container": "docker"
21+
},
22+
"remoteUser": "root",
723
"customizations": {
824
"vscode": {
925
"extensions": ["golang.Go"]

0 commit comments

Comments
 (0)