-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·46 lines (38 loc) · 1.5 KB
/
install.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
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -e
# This script simply builds the docker image and copies the script
# over to $HOME/bin.
# This must be run in the root directory of the dockerized-whistle
# repository, since that is where the Dockerfile is kept.
# if the user has Macbook with amd64, select compatible platform
PLATFORM=""
ARCH=$(arch);
if ARCH == "arm64"; then
PLATFORM="--platform linux/amd64"
fi
fi
docker build --build-arg DOCKER_USER=$USER $PLATFORM -t torstees/whistle .
echo "-----------------------------------------------------------------------"
echo "A docker image, ncpi/whistle, has been created. "
echo "-----------------------------------------------------------------------"
mkdir -p $HOME/bin
cp scripts/whistle $HOME/bin
echo "-----------------------------------------------------------------------"
echo "A script has been created at: $HOME/bin/whistle"
echo "This script will handle the docker related arguments allowing you run "
echo "whistle as if it were a native application"
echo "-----------------------------------------------------------------------"
echo ""
echo "Add the following line to the file, .bash_profile, in your home"
echo "directory to ensure that the script is in your PATH:"
echo
echo "export PATH=$PATH:$HOME/bin"
echo
echo "Then source the .bash_profile or log in again for the new PATH to take"
echo "effect. "
echo
echo "source $HOME/.bash_profile"
echo
echo "Once the script is in your PATH, you can run whistle like any other"
echo "command line tool:"
echo "whistle --help"