File: run_docker.sh

package info (click to toggle)
opentelemetry-cpp 1.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,744 kB
  • sloc: cpp: 79,029; sh: 1,640; makefile: 43; python: 31
file content (17 lines) | stat: -rwxr-xr-x 458 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

set -e

BUILD_IMAGE=opentelemetry-cpp-build
docker image inspect "$BUILD_IMAGE" &> /dev/null || {
  docker build -t "$BUILD_IMAGE" -f .devcontainer/Dockerfile.dev .
}

if [[ $# -ge 1 ]]; then
  docker run --user "$(id -u):$(id -g)" -v "$PWD":/src -w /src -it "$BUILD_IMAGE" "$@"
else
  docker run -v "$PWD":/src -w /src --privileged -it "$BUILD_IMAGE" /bin/bash -l
fi