Test allow forwarding in Dockerfile
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
# you will also find guides on how best to write your Dockerfile
|
3 |
-
|
4 |
FROM tensorflow/tensorflow:2.4.2-gpu
|
5 |
|
|
|
6 |
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
|
7 |
|
|
|
8 |
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common \
|
9 |
libsm6 libxext6 libxrender-dev curl \
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
@@ -16,8 +17,6 @@ RUN echo "**** Installing Python ****" && \
|
|
16 |
python3.7 get-pip.py && \
|
17 |
rm -rf /var/lib/apt/lists/*
|
18 |
|
19 |
-
RUN alias python="/usr/bin/python3.7"
|
20 |
-
|
21 |
WORKDIR /code
|
22 |
|
23 |
RUN apt-get update -y
|
@@ -30,6 +29,10 @@ RUN python3.7 -m pip install --no-cache-dir --upgrade -r /code/demo/requirements
|
|
30 |
# resolve issue with tf==2.4 and gradio dependency collision issue
|
31 |
RUN python3.7 -m pip install --force-reinstall typing_extensions==4.0.0
|
32 |
|
|
|
|
|
|
|
|
|
33 |
# Set up a new user named "user" with user ID 1000
|
34 |
RUN useradd -m -u 1000 user
|
35 |
|
|
|
1 |
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
# you will also find guides on how best to write your Dockerfile
|
|
|
3 |
FROM tensorflow/tensorflow:2.4.2-gpu
|
4 |
|
5 |
+
# fix for broken keys in Ubuntu-18.04
|
6 |
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
|
7 |
|
8 |
+
# install Python 3.7
|
9 |
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common \
|
10 |
libsm6 libxext6 libxrender-dev curl \
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
17 |
python3.7 get-pip.py && \
|
18 |
rm -rf /var/lib/apt/lists/*
|
19 |
|
|
|
|
|
20 |
WORKDIR /code
|
21 |
|
22 |
RUN apt-get update -y
|
|
|
29 |
# resolve issue with tf==2.4 and gradio dependency collision issue
|
30 |
RUN python3.7 -m pip install --force-reinstall typing_extensions==4.0.0
|
31 |
|
32 |
+
# allow container to access outside world
|
33 |
+
RUN apt-get update && apt install iptables -y
|
34 |
+
RUN sysctl net.ipv4.conf.all.forwarding=1
|
35 |
+
|
36 |
# Set up a new user named "user" with user ID 1000
|
37 |
RUN useradd -m -u 1000 user
|
38 |
|