-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9931613
Showing
3 changed files
with
112 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM alpine:3.6 | ||
|
||
LABEL maintainer="Juliano Petronetto <[email protected]>" | ||
LABEL org.label-schema.name="PyTorch Alpine" \ | ||
org.label-schema.description="PyTorch in Alpine Linux" \ | ||
org.label-schema.url="https://hub.docker.com/r/petronetto/pytorch-alpine" \ | ||
org.label-schema.vcs-url="https://github.com/petronetto/pytorch-alpine" \ | ||
org.label-schema.vendor="Petronetto DevTech" \ | ||
org.label-schema.version="1.0" \ | ||
org.label-schema.schema-version="1.0" | ||
|
||
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/main | tee /etc/apk/repositories \ | ||
&& echo http://dl-cdn.alpinelinux.org/alpine/edge/testing | tee -a /etc/apk/repositories \ | ||
&& echo http://dl-cdn.alpinelinux.org/alpine/edge/community | tee -a /etc/apk/repositories \ | ||
&& apk add --update --no-cache tini bash \ | ||
curl ca-certificates python3 py3-numpy py3-numpy-f2py libstdc++ \ | ||
## Setup de basic requeriments | ||
&& python3 -m ensurepip \ | ||
&& rm -r /usr/lib/python*/ensurepip \ | ||
&& pip3 --no-cache-dir install --upgrade pip setuptools \ | ||
&& if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip; fi \ | ||
&& if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi \ | ||
&& ln -s locale.h /usr/include/xlocale.h \ | ||
## Dev dependencies and others stuffs... | ||
&& apk add --no-cache --virtual=.build-dependencies \ | ||
build-base linux-headers python3-dev git cmake \ | ||
libffi-dev openblas-dev py-numpy-dev \ | ||
&& pip install -U --no-cache-dir pyyaml pymkl cffi \ | ||
ipywidgets notebook requests \ | ||
&& jupyter nbextension enable --py widgetsnbextension \ | ||
## Installing PyTorch | ||
&& git clone --recursive https://github.com/pytorch/pytorch \ | ||
&& cd pytorch && python setup.py install \ | ||
## Cleaning | ||
&& rm /usr/include/xlocale.h \ | ||
&& rm -rf /root/.cache \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& apk del .build-dependencies \ | ||
&& find /usr/lib/python3.6 -name __pycache__ | xargs rm -r \ | ||
&& rm -rf /root/.[acpw]* \ | ||
## Run notebook without token and disable warnings | ||
&& mkdir -p /root/.jupyter \ | ||
&& echo "import warnings" >> /root/.jupyter/config.py \ | ||
&& echo "warnings.filterwarnings('ignore')" >> /root/.jupyter/config.py \ | ||
&& echo "c.NotebookApp.token = u''" >> /root/.jupyter/config.py | ||
|
||
EXPOSE 5000 | ||
|
||
WORKDIR /notebooks | ||
|
||
ENTRYPOINT ["/sbin/tini", "--"] | ||
|
||
CMD ["jupyter", "notebook", "--port=5000", "--no-browser", "--allow-root", "--ip=0.0.0.0", "--NotebookApp.token="] |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2017, Juliano Petronetto | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
``` | ||
██████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ██████╗██╗ ██╗ | ||
██╔══██╗╚██╗ ██╔╝╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝██║ ██║ | ||
██████╔╝ ╚████╔╝ ██║ ██║ ██║██████╔╝██║ ███████║ | ||
██╔═══╝ ╚██╔╝ ██║ ██║ ██║██╔══██╗██║ ██╔══██║ | ||
██║ ██║ ██║ ╚██████╔╝██║ ██║╚██████╗██║ ██║ | ||
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ | ||
``` | ||
|
||
[](https://microbadger.com/images/petronetto/pytorch-alpine:latest "Get your own image badge on microbadger.com") | ||
[](https://microbadger.com/images/petronetto/pytorch-alpinee:latest "Get your own version badge on microbadger.com") | ||
[](https://microbadger.com/images/petronetto/pytorch-alpine "Get your own image badge on microbadger.com") | ||
[](https://github.com/petronetto/pytorch-alpine/issues) | ||
[](https://raw.githubusercontent.com/petronetto/pytorch-alpine/master/LICENSE) | ||
[](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fpetronetto%2Fpytorch-alpine) | ||
|
||
|
||
## Running the container | ||
|
||
Simply run the following command and open your browser in http://localhost:5000. | ||
|
||
``` | ||
docker run -it \ | ||
-v $(PWD):/notebooks \ | ||
-p 5000:5000 \ | ||
petronetto/pytorch-alpine | ||
``` | ||
|
||
## License | ||
[BSD 3-Clause License](https://raw.githubusercontent.com/petronetto/pytorch-alpine/master/LICENSE) |