diff --git a/.dockerignore b/.dockerignore index 050b8bce..198b23ec 100644 --- a/.dockerignore +++ b/.dockerignore @@ -13,5 +13,4 @@ html/* __pycache__ # Compiled Documentation -site/ -Makefile +docs/_build diff --git a/Dockerfile-docs b/Dockerfile-docs index 6f419400..105083e8 100644 --- a/Dockerfile-docs +++ b/Dockerfile-docs @@ -1,12 +1,13 @@ FROM python:3.5 -RUN mkdir /src +ARG uid=1000 +ARG gid=1000 + +RUN addgroup --gid $gid sphinx \ + && useradd --uid $uid --gid $gid -M sphinx + WORKDIR /src +COPY requirements.txt docs-requirements.txt ./ +RUN pip install -r requirements.txt -r docs-requirements.txt -COPY requirements.txt /src/requirements.txt -RUN pip install -r requirements.txt - -COPY docs-requirements.txt /src/docs-requirements.txt -RUN pip install -r docs-requirements.txt - -COPY . /src +USER sphinx diff --git a/Makefile b/Makefile index e4c64e71..cd117467 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ build-py3: .PHONY: build-docs build-docs: - docker build -t docker-sdk-python-docs -f Dockerfile-docs . + docker build -t docker-sdk-python-docs -f Dockerfile-docs --build-arg uid=$(shell id -u) --build-arg gid=$(shell id -g) . .PHONY: build-dind-certs build-dind-certs: @@ -77,7 +77,7 @@ flake8: build .PHONY: docs docs: build-docs - docker run --rm -it -v `pwd`:/code docker-sdk-python-docs sphinx-build docs ./_build + docker run --rm -it -v `pwd`:/src docker-sdk-python-docs sphinx-build docs docs/_build .PHONY: shell shell: build