-
Notifications
You must be signed in to change notification settings - Fork 255
/
open-in-docker.sh
executable file
·33 lines (29 loc) · 1.11 KB
/
open-in-docker.sh
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-2024, 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 "$@"