Skip to content

Instantly share code, notes, and snippets.

Created August 7, 2016 19:02
Show Gist options
  • Star 25 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save anonymous/fea9c0a9e986eeda7cf58e47f47c89f2 to your computer and use it in GitHub Desktop.
Save anonymous/fea9c0a9e986eeda7cf58e47f47c89f2 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
ln -s /usr/lib/x86_64-linux-gnu/amdgpu-pro .
ln -s /etc/OpenCL .
tar -czvf libs.tar.gz amdgpu-pro/*
tar -czvf conf.tar.gz OpenCL/*
cat > .dockerignore << EOF
OpenCL
amdgpu-pro
EOF
cat > Dockerfile << EOF
FROM ubuntu:16.04
ADD libs.tar.gz /usr/lib
ADD conf.tar.gz /etc
RUN ldconfig /usr/lib /usr/lib/amdgpu-pro
CMD ["bash"]
EOF
docker build -t climage .
echo "Finished. Run with:"
echo " docker run --device /dev/dri:/dev/dri <extra-params> climage <command>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment