diff --git a/Dockerfile b/Dockerfile index f916703..d6c5002 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,12 +6,15 @@ ENV APP_NAME="iDRAC 6" \ COPY keycode-hack.c /keycode-hack.c RUN apt-get update && \ - apt-get install -y software-properties-common wget && \ + apt-get install -y wget software-properties-common && \ add-apt-repository ppa:openjdk-r/ppa && \ apt-get update && \ apt-get install -y openjdk-7-jdk gcc && \ gcc -o /keycode-hack.so /keycode-hack.c -shared -s -ldl -fPIC && \ - rm -rf /var/lib/apt/lists/* + apt-get remove -y gcc wget software-properties-common && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* && \ + rm /keycode-hack.c RUN mkdir /app && \ chown ${USER_ID}:${GROUP_ID} /app diff --git a/startapp.sh b/startapp.sh index 9376177..5971f6a 100644 --- a/startapp.sh +++ b/startapp.sh @@ -93,4 +93,10 @@ cd /app echo "${GREEN}Initialization complete, starting virtual console${NC}" -LD_PRELOAD=/keycode-hack.so exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=5900 vport=5900 user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:443/help/contents.html" +if [ -n "$ENABLE_KEYCODE_HACK" ]; then + echo "Enabling keycode hack" + + export LD_PRELOAD=/keycode-hack.so +fi + +exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=5900 vport=5900 user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:443/help/contents.html"