Skip to content

Commit

Permalink
Remove old Vulkan "default" Dockerfile (which was never intended to get
Browse files Browse the repository at this point in the history
special treatment).

Add new Vulkan Dockerfile using current versions of the toolchain and
hijacking some of @rpavlik's script to allow setting the user/group at
docker invocation.
  • Loading branch information
oddhack committed Mar 23, 2020
1 parent feac0c8 commit eea4cbf
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 27 deletions.
1 change: 0 additions & 1 deletion Dockerfile.latest

This file was deleted.

58 changes: 36 additions & 22 deletions Dockerfile → Dockerfile.vulkan-docs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019 The Khronos Group Inc.
# Copyright (c) 2019-2020 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,12 +14,16 @@

# This is a Docker container for Vulkan specification builds

from ruby:2.6
from ruby:2.7
label maintainer="Jon Leech <[email protected]>"

# Install standard Debian packages
# TODO add --no-install-recommends
run apt-get update -qq && apt-get install -y -qq \
# This adds the Node.js repository to the apt registry
# nodejs is actually installed in the next step
run curl -sL https://deb.nodesource.com/setup_12.x | bash -

# Install required Debian packages
run apt-get update -qq && \
apt-get install -y -qq --no-install-recommends \
bison \
build-essential \
cmake \
Expand All @@ -29,6 +33,7 @@ run apt-get update -qq && apt-get install -y -qq \
gcc \
ghostscript \
git \
gosu \
g++ \
jing \
libcairo2-dev \
Expand All @@ -37,34 +42,35 @@ run apt-get update -qq && apt-get install -y -qq \
libpango1.0-dev \
libreadline-dev \
libxml2-dev \
nodejs \
pdftk \
poppler-utils \
python3 \
python3-pytest \
python3-termcolor \
ruby \
ttf-lyx && \
apt-get clean

# Force-install an older version of i18n so the 1.5.2 version, which
# won't work with ruby 2.1, doesn't abort the CI job when installing
# other gems which need it.
run gem install i18n -v 1.5.1
run gem install asciidoctor asciidoctor-mathematical coderay json-schema
tcsh && \
apt-get clean && \
gem install \
asciidoctor \
asciidoctor-diagram \
asciidoctor-mathematical \
asciidoctor-pdf \
coderay \
json-schema \
i18n

# Install chunked index generation scripts and add lunr to node searchpath
run curl -sL https://deb.nodesource.com/setup_8.x | bash -
run apt-get update -qq && apt-get install -y nodejs && apt-get clean
run npm install -g [email protected]
env NODE_PATH /usr/lib/node_modules

# Install Roswell and asciidoctor-chunker. Need at least this specific
# version (later may be OK, too)
run curl -fsSL -o roswell.deb https://github.com/roswell/roswell/releases/download/v19.4.10.98/roswell_19.4.10.98-1_amd64.deb
run dpkg -i roswell.deb
run ros install alexandria lquery cl-fad
run mkdir -p $HOME/common-lisp
run (cd $HOME/common-lisp && git clone https://github.com/wshito/asciidoctor-chunker.git)
# version (later may be OK, too). There seems to be no roswell APT
# repository.
run curl -fsSL -o roswell.deb https://github.com/roswell/roswell/releases/download/v20.01.14.104/roswell_20.01.14.104-1_amd64.deb && \
dpkg -i roswell.deb && \
ros install alexandria lquery cl-fad && \
mkdir -p $HOME/common-lisp && \
(cd $HOME/common-lisp && git clone https://github.com/wshito/asciidoctor-chunker.git)

# Ensure the proper locale is installed and used - not present in ruby image
# See https://serverfault.com/questions/54591/how-to-install-change-locale-on-debian#54597
Expand All @@ -74,3 +80,11 @@ run apt-get install -y -qq locales && \
apt-get clean
env LANG en_US.UTF-8

# Should move back to Debian packages stage above once CI works
run apt-get install -y -qq --no-install-recommends bash

# Add the entrypoint to the image
COPY entrypoint.vulkan.sh /root/entrypoint.vulkan.sh
RUN chmod +x /root/entrypoint.vulkan.sh

ENTRYPOINT ["/root/entrypoint.vulkan.sh"]
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Khronos documentation and software.
Images built from this repo are pushed to https://hub.docker.com/r/khronosgroup/docker-images -
Each Dockerfile corresponds to a tag, where the extension of the Dockerfile (e.g., `openxr`, `openxr-sdk`)
matches the name of the tag.
(The Dockerfile with no extension corresponds to the `latest` tag.)

## Scripts

Expand Down
2 changes: 1 addition & 1 deletion build-and-push-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e

(
cd $(dirname $0)
./build-and-push-one.sh Dockerfile "$@"
./build-and-push-one.sh Dockerfile.vulkan-docs "$@"
./build-and-push-one.sh Dockerfile.openxr-base "$@"
./build-and-push-one.sh Dockerfile.openxr "$@"
./build-and-push-one.sh Dockerfile.openxr-sdk "$@"
Expand Down
1 change: 0 additions & 1 deletion build-and-push-one.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Pass a dockerfile name.
# The dockerfile's extension is used as the tag within the repo.
# For the default dockerfile with no extension, the tag is "latest"

set -e

Expand Down
1 change: 0 additions & 1 deletion build-one.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# Pass a dockerfile name.
# The dockerfile's extension is used as the tag within the repo.
# For the default dockerfile with no extension, the tag is "latest"

set -e

Expand Down
61 changes: 61 additions & 0 deletions entrypoint.vulkan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
# Copyright (c) 2019 The Khronos Group, Inc.
# Copyright (c) 2019 Collabora, Ltd
# Copyright (c) 2017-2018 Sensics, Inc.
# Copyright (c) 2014 Kyle Manna
# SPDX-License-Identifier: MIT

# Based in part on:
# https://github.com/kylemanna/docker-aosp/blob/master/utils/docker_entrypoint.sh
# https://github.com/sensics/tegra-android-builder/blob/master/content/docker_entrypoint.sh

set -e

# Run this container with a non-root user, optionally specified by the
# external environment variables USERID, GROUPID, USER, and GROUP.
USERID=${USERID-1000}
GROUPID=${GROUPID-100}
USER=${USER-vulkan}
GROUP=${GROUP-users}

if egrep -q ":$GROUPID:|^$GROUP:" /etc/group ; then
true
# echo "** Not creating group $GROUP id $GROUPID; group line is"
# egrep ":$GROUPID:|^$GROUP:" /etc/group
else
echo "** Creating group $GROUP id $GROUPID"
groupadd -g $GROUPID -r $GROUP > /dev/null || true
fi

if egrep -q ":$USERID:|^$USER:" /etc/passwd ; then
true
# echo "** Not creating user $USER id $USERID; passwd line is"
# egrep ":$USERID:|^$USER:" /etc/passwd
else
echo "** Creating user $USER id $USERID"
useradd -u $USERID --create-home -r -g $GROUP $USER || true
fi

export HOME=/home/$USER
export USER

echo "HOME=$HOME USER=$USER CONTAINER_CWD=$CONTAINER_CWD"

if [ "${CONTAINER_CWD}" ]; then
cd ${CONTAINER_CWD}
fi

# Default to 'bash' if no arguments are provided
args="$@"
if [ -z "$args" ]; then
args=/bin/bash
else
# Actually, always use it, because CI appears to be passing in some horrid bash script as the arguments
echo -n "** ignoring entrypoint.vulkan.sh args - length was "
echo $args | wc -c
args=/bin/bash
fi

echo "** About to gosu $USER $args"
exec gosu $USER $args
echo "** After gosu - should not reach this point"

0 comments on commit eea4cbf

Please sign in to comment.