|
| 1 | +# Copyright 2018 The TensorFlow Authors. All Rights Reserved. |
| 2 | +# Copyright 2020 University of Waikato, Hamilton, NZ. All Rights Reserved. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | +# ============================================================================== |
| 17 | + |
| 18 | +export PS1="\[\e[31m\]docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > " |
| 19 | +export TERM=xterm-256color |
| 20 | +alias grep="grep --color=auto" |
| 21 | +alias ls="ls --color=auto" |
| 22 | + |
| 23 | +echo -e "\e[1;31m" |
| 24 | +cat<<DBG |
| 25 | + _____ |
| 26 | + _ ____ ____ _|___ / |
| 27 | +| '_ \\ \\ /\\ / /\\ \\ /\\ / / |_ \\ |
| 28 | +| |_) \\ V V / \\ V V / ___) | |
| 29 | +| .__/ \\_/\\_/ \\_/\\_/ |____/ |
| 30 | +|_| |
| 31 | + |
| 32 | +0.2.11, OpenJDK 8, Python 3.8, CUDA 10.2 |
| 33 | + |
| 34 | +DBG |
| 35 | +echo -e "\e[0;33m" |
| 36 | + |
| 37 | +if [[ $EUID -eq 0 ]]; then |
| 38 | + cat <<WARN |
| 39 | +WARNING: You are running this container as root, which can cause new files in |
| 40 | +mounted volumes to be created as the root user on your host machine. |
| 41 | + |
| 42 | +To avoid this, run the container by specifying your user's userid: |
| 43 | + |
| 44 | +$ docker run -u \$(id -u):\$(id -g) args... |
| 45 | +WARN |
| 46 | +else |
| 47 | + cat <<EXPL |
| 48 | +You are running this container as user with ID $(id -u) and group $(id -g), |
| 49 | +which should map to the ID and group for your user on the Docker host. Great! |
| 50 | +EXPL |
| 51 | +fi |
| 52 | + |
| 53 | +# Turn off colors |
| 54 | +echo -e "\e[m" |
0 commit comments