2018-11-13 12:11:59 +08:00
|
|
|
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
###########################################################
|
2023-10-04 12:39:15 +08:00
|
|
|
# OS and UTILS
|
2018-11-13 12:11:59 +08:00
|
|
|
###########################################################
|
|
|
|
|
2020-09-26 03:38:44 +08:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
2018-11-13 12:11:59 +08:00
|
|
|
apt-get update
|
2023-10-04 12:39:15 +08:00
|
|
|
apt-get install --no-install-recommends -y locales tzdata ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq
|
|
|
|
locale-gen en_US.utf8
|
2020-09-26 03:38:44 +08:00
|
|
|
ln -fs /usr/share/zoneinfo/UTC /etc/localtime
|
|
|
|
dpkg-reconfigure --frontend noninteractive tzdata
|
2018-11-13 12:11:59 +08:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2021-10-05 15:08:36 +08:00
|
|
|
curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/concourse-java.sh > /opt/concourse-java.sh
|
2018-11-13 12:11:59 +08:00
|
|
|
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
# JAVA
|
|
|
|
###########################################################
|
2018-12-11 11:20:11 +08:00
|
|
|
JDK_URL=$( ./get-jdk-url.sh $1 )
|
2019-02-14 08:52:46 +08:00
|
|
|
|
2018-11-13 12:11:59 +08:00
|
|
|
mkdir -p /opt/openjdk
|
|
|
|
cd /opt/openjdk
|
2019-02-14 08:52:46 +08:00
|
|
|
curl -L ${JDK_URL} | tar zx --strip-components=1
|
2018-12-01 02:02:20 +08:00
|
|
|
test -f /opt/openjdk/bin/java
|
2019-03-21 01:15:36 +08:00
|
|
|
test -f /opt/openjdk/bin/javac
|
2018-11-13 12:11:59 +08:00
|
|
|
|
2021-03-05 23:17:13 +08:00
|
|
|
if [[ $# -eq 2 ]]; then
|
2021-03-06 01:42:06 +08:00
|
|
|
cd /
|
2021-03-05 23:17:13 +08:00
|
|
|
TOOLCHAIN_JDK_URL=$( ./get-jdk-url.sh $2 )
|
|
|
|
|
|
|
|
mkdir -p /opt/openjdk-toolchain
|
|
|
|
cd /opt/openjdk-toolchain
|
|
|
|
curl -L ${TOOLCHAIN_JDK_URL} | tar zx --strip-components=1
|
|
|
|
test -f /opt/openjdk-toolchain/bin/java
|
|
|
|
test -f /opt/openjdk-toolchain/bin/javac
|
|
|
|
fi
|
2018-11-13 12:11:59 +08:00
|
|
|
|
2023-10-11 03:31:28 +08:00
|
|
|
|
2018-11-13 12:11:59 +08:00
|
|
|
###########################################################
|
|
|
|
# DOCKER
|
|
|
|
###########################################################
|
|
|
|
cd /
|
2020-04-04 01:09:02 +08:00
|
|
|
DOCKER_URL=$( ./get-docker-url.sh )
|
2020-03-15 22:27:08 +08:00
|
|
|
curl -L ${DOCKER_URL} | tar zx
|
2018-11-13 12:11:59 +08:00
|
|
|
mv /docker/* /bin/
|
|
|
|
chmod +x /bin/docker*
|
|
|
|
|
|
|
|
export ENTRYKIT_VERSION=0.4.0
|
|
|
|
curl -L https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz | tar zx
|
|
|
|
chmod +x entrykit && \
|
|
|
|
mv entrykit /bin/entrykit && \
|
|
|
|
entrykit --symlink
|
2020-02-25 18:06:52 +08:00
|
|
|
|
2023-10-11 03:31:28 +08:00
|
|
|
|
2023-03-24 01:25:37 +08:00
|
|
|
###########################################################
|
|
|
|
# DOCKER COMPOSE
|
|
|
|
###########################################################
|
|
|
|
mkdir -p /usr/local/lib/docker/cli-plugins
|
|
|
|
DOCKER_COMPOSE_URL=$( ./get-docker-compose-url.sh )
|
|
|
|
curl -L ${DOCKER_COMPOSE_URL} -o /usr/local/lib/docker/cli-plugins/docker-compose
|
|
|
|
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
|