-
Notifications
You must be signed in to change notification settings - Fork 6
/
stable.Dockerfile
48 lines (34 loc) · 1.64 KB
/
stable.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# We run a multi-stage Dockerfile which can generate --target (dev or prod)
# following https://blog.mikesir87.io/2018/07/leveraging-multi-stage-builds-single-dockerfile-dev-prod/
FROM jupyter/scipy-notebook:dc9744740e12 as dev
LABEL scanner_maintainer="[email protected], Praetorian <[email protected]>"
USER root
RUN apt-get update && \
apt-get install -y gnupg && \
apt-get install -y curl
RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ bionic main" | \
tee /etc/apt/sources.list.d/azure-cli.list && \
curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN apt-get install apt-transport-https && \
apt-get update && apt-get install -y azure-cli
RUN apt-get install -y jq && \
apt-get clean
# In development mode, create these symlinks to make changes to repo.
# ln -s /praetorian-tools/azure_cis_scanner/azure_cis_scanner.ipynb /home/jovyan/work/
# ln -s /praetorian-tools/azure_cis_scanner/utils.py /home/jovyan/work
COPY requirements.txt .
RUN pip install -r requirements.txt
# Acutally install azscanner for production
# build base container:
# docker build -t azscan-dev --target dev .
# build prod container:
# docker build -t azscan-prod --target prod .
WORKDIR /praetorian-tools/azure_cis_scanner
From dev as prod
RUN pip install azure_cis_scanner
# In development mode, it may be preferable to symlink these to make changes to repo.
COPY azure_cis_scanner/azure_cis_scanner.ipynb /home/jovyan/work/
COPY azure_cis_scanner/utils.py /home/jovyan/work
USER $NB_UID