FROM debian:testing as builder
RUN apt-get update \
&& apt-get install -y \
apt-file \
beignet-opencl-icd \
build-essential \
cmake \
git \
libopencv-dev \
ocl-icd-opencl-dev \
opencl-headers
RUN git clone --depth=1 https://github.com/DeadSix27/waifu2x-converter-cpp \
&& cd waifu2x-converter-cpp \
&& mkdir out \
&& cd out \
&& cmake -DENABLE_CUDA=OFF .. \
&& make -j 4 \
&& make install \
&& ldconfig \
&& cd ../../ \
&& rm -rf waifu2x-converter-cpp
#COPY freeze.sh /
#
#RUN apt-file update \
# && /freeze.sh waifu2x-converter-cpp
FROM debian:testing-slim
#COPY --from=builder /tmp/frozen_packages /tmp/frozen_packages
COPY frozen_packages /tmp/frozen_packages
&& apt-get install --no-install-recommends -y \
tini \
ocl-icd-libopencl1 \
&& xargs -a /tmp/frozen_packages apt-get install --no-install-recommends -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local
RUN ldconfig
ENTRYPOINT ["tini", "--", "waifu2x-converter-cpp"]