Skip to content

Commit

Permalink
Add docker hub link
Browse files Browse the repository at this point in the history
The new docker hub badge added as part of the docker image build action was missing a target.
  • Loading branch information
bdevans committed Mar 11, 2024
1 parent 03548fa commit c7eed0c
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions docker/Dockerfile.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# docker buildx build --push --platform linux/amd64,linux/arm64/v8 -o type=image -t briansimulator/brian -f docker/Dockerfile .
# docker run -it --init --rm -p 8888:8888 briansimulator/brian

ARG BASE_IMAGE_TAG=3.12-slim-bookworm
FROM python:${BASE_IMAGE_TAG}

LABEL maintainer="Ben Evans <B.D.Evans@sussex.ac.uk>" \
org.opencontainers.image.vendor="The Brian Development Team" \
org.opencontainers.image.licenses="CeCILL 2.1" \
org.opencontainers.image.title="Brian Docker Image" \
org.opencontainers.image.description="Docker image for Brian - a free, open source simulator for spiking neural networks" \
org.opencontainers.image.homepage="https://briansimulator.org" \
org.opencontainers.image.url="https://hub.docker.com/r/briansimulator/brian" \
org.opencontainers.image.source="https://github.com/brian-team/brian2" \
org.opencontainers.image.documentation="https://brian2.readthedocs.io/"

# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
git \
libgs-dev \
python3-dev \
sudo

# Install Brian and recommended packages
RUN pip install \
brian2 \
brian2tools \
scipy \
matplotlib \
jupyterlab \
pytest \
pytest-xdist

# Create a non-root user
ARG USER="monty" \
GROUP="monty" \
PASSWORD="monty"
# RUN useradd -ms /bin/bash ${USER} && echo "${USER}:${PASSWORD}" | chpasswd && adduser ${USER} sudo
RUN groupadd ${GROUP} && \
useradd -ms /bin/bash -g ${GROUP} -G sudo ${USER} && \
echo "${USER}:${PASSWORD}" | chpasswd
ENV HOME="/home/${USER}"
RUN chown -R ${USER}:${USER} ${HOME}
USER ${USER}

# Copy tutorial notebooks and example scripts to home directory
WORKDIR ${HOME}
RUN git clone https://github.com/brian-team/brian2.git \
&& mv brian2/examples examples \
&& mv brian2/tutorials tutorials \
&& chmod -R +x tutorials \
&& chmod -R +x examples \
&& find . -name '*.ipynb' -exec jupyter trust {} \; \
&& rm -rf brian2

EXPOSE 8888

# CMD ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root"]
CMD ["jupyter", "lab", "--ip=0.0.0.0"]
# CMD [ "/bin/bash" ]

0 comments on commit c7eed0c

Please sign in to comment.