diff --git a/Dockerfile b/Dockerfile index 58b67cf..9f7073a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,24 @@ ## Buildstage ## -FROM ghcr.io/linuxserver/baseimage-alpine:3.12 as buildstage +FROM ghcr.io/linuxserver/baseimage-alpine:3.14 as buildstage ARG COMP_RT_RELEASE RUN \ - echo "**** install packages ****" && \ - apk add --no-cache \ + echo "**** install packages ****" && \ + apk add --no-cache \ curl \ jq && \ - if [ -z "${COMP_RT_RELEASE}" ]; then \ + if [ -z "${COMP_RT_RELEASE}" ]; then \ COMP_RT_RELEASE=$(curl -sX GET "https://api.github.com/repos/intel/compute-runtime/releases/latest" | jq -r '.tag_name'); \ - fi && \ - COMP_RT_URLS=$(curl -sX GET "https://api.github.com/repos/intel/compute-runtime/releases/tags/${COMP_RT_RELEASE}" | jq -r '.body' | grep wget | grep -v ww47 | sed 's|wget ||g') && \ - echo "**** grab debs ****" && \ - mkdir -p /root-layer/opencl-intel && \ - for i in $COMP_RT_URLS; do \ + fi && \ + COMP_RT_URLS=$(curl -sX GET "https://api.github.com/repos/intel/compute-runtime/releases/tags/${COMP_RT_RELEASE}" | jq -r '.body' | grep wget | grep -v ww47 | sed 's|wget ||g') && \ + echo "**** grab debs ****" && \ + mkdir -p /root-layer/opencl-intel && \ + for i in $COMP_RT_URLS; do \ echo "**** downloading ${i%$'\r'} ****" && \ curl -o /root-layer/opencl-intel/$(basename "${i%$'\r'}") \ - -L "${i%$'\r'}"; \ - done + -L "${i%$'\r'}"; \ + done # copy local files COPY root/ /root-layer/ diff --git a/root/etc/cont-init.d/95-apt-get b/root/etc/cont-init.d/95-apt-get new file mode 100644 index 0000000..5b1a21c --- /dev/null +++ b/root/etc/cont-init.d/95-apt-get @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash + +apt-get update diff --git a/root/etc/cont-init.d/98-opencl-intel b/root/etc/cont-init.d/98-opencl-intel index 2fc4d82..3bc20ba 100644 --- a/root/etc/cont-init.d/98-opencl-intel +++ b/root/etc/cont-init.d/98-opencl-intel @@ -2,24 +2,23 @@ # Determine if setup is needed if [ ! -f "/usr/bin/apt" ]; then - echo "**** Image is not Ubuntu, skipping opencl-intel install ****" - exit 0 + echo "**** Image is not Ubuntu, skipping opencl-intel install ****" + exit 0 fi if [ $(uname -m) != "x86_64" ]; then - echo "**** Opencl-intel only works on X86_64, skipping ****" - exit 0 + echo "**** Opencl-intel only works on X86_64, skipping ****" + exit 0 fi echo "**** Installing clinfo ****" -apt-get update apt-get install -y \ - clinfo + clinfo if [ -d /opencl-intel ]; then - echo "**** Installing/updating opencl-intel debs ****" - dpkg -i /opencl-intel/*.deb - rm -rf /opencl-intel + echo "**** Installing/updating opencl-intel debs ****" + dpkg -i /opencl-intel/*.deb + rm -rf /opencl-intel else - echo "**** Opencl-intel already installed ****" + echo "**** Opencl-intel already installed ****" fi