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