Last active
June 21, 2020 04:16
-
-
Save jetsonhacks/9fcebd560c89ac6a203886a1e91195c5 to your computer and use it in GitHub Desktop.
Dockerfile to build image for oceanfft container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2020, JetsonHacks. All rights reserved. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the "Software"), | |
# to deal in the Software without restriction, including without limitation | |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
# and/or sell copies of the Software, and to permit persons to whom the | |
# Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in | |
# all copies or substantial portions of the Software. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
# DEALINGS IN THE SOFTWARE. | |
# To enable access to the CUDA compiler (nvcc) during docker build operations, add "default-runtime": "nvidia" to your /etc/docker/daemon.json configuration file before attempting to build the containers: | |
# REMEMBER the pound sign is the comment for the Docker file, you will need to remove them for the real json file | |
# { | |
# "runtimes": { | |
# "nvidia": {sudo | |
# "path": "nvidia-container-runtime", | |
# "runtimeArgs": [] | |
# } | |
# }, | |
# | |
# "default-runtime": "nvidia" | |
# } | |
# Remember the , after "runtimes" {} | |
#You will then want to restart the Docker service or reboot your system before proceeding. | |
# $ sudo systemctl restart docker | |
# Run the oceanfft simulation sample | |
FROM nvcr.io/nvidia/l4t-base:r32.4.2 | |
RUN apt-get update && apt-get install -y --no-install-recommends make g++ | |
# RUN runs a command inside the container | |
# With the COPY command, you can copy files in the Docker build context (the directory from which you are building the Docker image) into the image | |
# Because the files are already in the l4t-base:r32.4.2 image, we copy them from there | |
# We don't really need to copy them to the tmp directory, but do it here as an example | |
RUN cp -r /usr/local/cuda/samples /tmp/samples | |
WORKDIR /tmp/samples/5_Simulations/oceanFFT | |
RUN make clean && make | |
CMD ["./oceanFFT"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment