File: open-in-docker.sh

package info (click to toggle)
openxr-sdk-source 1.1.47~ds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,804 kB
  • sloc: cpp: 63,078; python: 20,501; xml: 15,759; ansic: 6,418; sh: 910; makefile: 426; ruby: 386
file content (33 lines) | stat: -rwxr-xr-x 1,140 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Copyright (c) 2019-2025 The Khronos Group Inc.
# Copyright (c) 2019 Collabora, Ltd.
# SPDX-License-Identifier: Apache-2.0

# Start the docker image named below, for spec generation, etc.
# Mounts this directory as the mountpoint mentioned below,
# and logs you in as a normal user whose user ID and group ID match
# your outside-of-container user, thus avoiding mangling permissions.
# Container is automatically removed when you exit it.

# The docker images used are published here:
# https://hub.docker.com/r/khronosgroup/docker-images/tags
#
# with their dockerfile located at:
# https://github.com/KhronosGroup/DockerContainers

# This image/tag is generated from https://github.com/KhronosGroup/DockerContainers/blob/main/openxr.Dockerfile
# Purpose: Spec (pdf/html) generation
IMAGE_NAME=khronosgroup/docker-images:openxr.20240805
MOUNTPOINT=$(pwd)

set -e
# docker pull $IMAGE_NAME
uid=$(id -u)
gid=$(id -g)
docker run -it --rm \
    --entrypoint /root/entrypoint.openxr.sh \
    -e "USER_ID=$uid" \
    -e "GROUP_ID=$gid" \
    -e "CONTAINER_CWD=$MOUNTPOINT" \
    -v "$MOUNTPOINT:$MOUNTPOINT" \
    $IMAGE_NAME "$@"