-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #601 from genn-team/ben_docker_improvements
Docker improvements
- Loading branch information
Showing
2 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
ARG BASE=11.5.0-devel-ubuntu20.04 | ||
FROM nvidia/cuda:${BASE} | ||
|
||
LABEL maintainer="[email protected]" | ||
LABEL version="4.8.0" | ||
LABEL org.opencontainers.image.documentation="https://genn-team.github.io/" | ||
LABEL org.opencontainers.image.source="https://github.com/genn-team/genn" | ||
LABEL org.opencontainers.image.title="GeNN Docker image" | ||
|
||
# Update APT database and upgrade any outdated packages | ||
ARG GENN_VER | ||
LABEL maintainer="[email protected]" \ | ||
version=${GENN_VER} \ | ||
org.opencontainers.image.documentation="https://genn-team.github.io/" \ | ||
org.opencontainers.image.source="https://github.com/genn-team/genn" \ | ||
org.opencontainers.image.title="GeNN Docker image" | ||
|
||
# Update APT database and upgrade any outdated packages and install Python, pip and swig | ||
RUN apt-get update && \ | ||
apt-get upgrade -y | ||
|
||
# Install Python, pip and swig | ||
RUN apt-get install -yq --no-install-recommends python3-dev python3-pip swig gosu nano | ||
|
||
# Set CUDA environment variable | ||
ENV CUDA_PATH=/usr/local/cuda | ||
apt-get upgrade -y && \ | ||
apt-get install -yq --no-install-recommends python3-dev python3-pip swig gosu nano | ||
|
||
ENV GENN_PATH=/opt/genn | ||
# Set environment variables | ||
ENV CUDA_PATH=/usr/local/cuda \ | ||
GENN_PATH=/opt/genn | ||
|
||
# Upgrade pip itself | ||
RUN pip install --upgrade pip | ||
# Set python3 to be the default version of python | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 | ||
|
||
# Install numpy and jupyter | ||
RUN pip install numpy jupyter matplotlib | ||
# Upgrade pip itself and install numpy and jupyter | ||
RUN python -m pip install --upgrade pip && \ | ||
python -m pip install numpy jupyter matplotlib | ||
|
||
# Copy GeNN into /opt | ||
COPY . ${GENN_PATH} | ||
COPY . ${GENN_PATH} | ||
|
||
# Use this as working directory | ||
WORKDIR ${GENN_PATH} | ||
|
||
# Install GeNN and PyGeNN | ||
RUN make install -j `lscpu -p | egrep -v '^#' | sort -u -t, -k 2,4 | wc -l` | ||
RUN make DYNAMIC=1 LIBRARY_DIRECTORY=${GENN_PATH}/pygenn/genn_wrapper/ -j `lscpu -p | egrep -v '^#' | sort -u -t, -k 2,4 | wc -l` | ||
RUN python3 setup.py develop | ||
|
||
# Default command will be to launch bash | ||
CMD ["/bin/bash"] | ||
RUN python setup.py develop | ||
|
||
# Start entrypoint | ||
# **NOTE** in 'exec' mode shell arguments aren't expanded so can't use environment variables | ||
ENTRYPOINT ["/opt/genn/bin/genn-docker-entrypoint.sh"] | ||
|
||
# Default command will be to launch bash | ||
CMD ["/bin/bash"] |
This file contains 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