forked from KhronosGroup/OpenXR-Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopen-in-docker.sh
executable file
·32 lines (28 loc) · 1.1 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
#!/bin/bash
# Copyright (c) 2019 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/master/Dockerfile.openxr
# Purpose: Spec (pdf/html) generation
IMAGE_NAME=khronosgroup/docker-images:openxr
MOUNTPOINT=$(pwd)
set -e
# docker pull $IMAGE_NAME
uid=$(id -u)
gid=$(id -g)
USER_ID_ARGS="-e USER_ID=$uid -e GROUP_ID=$gid"
docker run -it --rm \
${USER_ID_ARGS} \
-e CONTAINER_CWD=$MOUNTPOINT \
--mount type=bind,source=$MOUNTPOINT,target=$MOUNTPOINT \
$IMAGE_NAME "$@"