-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
100 lines (77 loc) · 3.05 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Dockerfile for runnig and distributing the app
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
ENV force_color_prompt=yes
# paths for python
ENV PYTHONPATH=/app:/app/lib:/app/src:/app/py:/app/python:/app/cli:/app/utils:/app/tests
# misc
RUN apt-get update && apt-get install -qy \
openssh-client \
lsb-release \
python3-pip \
apt-utils \
expect \
unzip \
rsync \
curl \
wget \
gpg \
jq
# hashicorp sources
RUN wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
tee /etc/apt/sources.list.d/hashicorp.list
RUN apt-get update
# terraform
RUN apt-get install -qy terraform
# install packer
RUN apt-get install -yq packer
# init packer plugins
COPY . /tmp/app
RUN (cd /tmp/app/src/packer/azure/isaac && packer init .)
RUN (cd /tmp/app/src/packer/aws/isaac && packer init .)
# azure command line
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
# store azure credentials in a persistent location
RUN ln -s /app/state/.azure /root/.azure
# create dir if it doesnt exist
RUN echo "mkdir -p /app/state/.azure" >> /root/.bashrc
# pip
RUN pip install click randomname pwgen debugpy
# ansible
ENV ANSIBLE_FORCE_COLOR=true
# for some reason, the ansible.cfg file is not being picked up on Windows
ENV ANSIBLE_CONFIG="/app/src/ansible/ansible.cfg"
RUN pip install ansible
RUN ansible-galaxy collection install community.docker
# ngc cli: https://docs.ngc.nvidia.com/cli/script.html
RUN cd /opt && wget https://ngc.nvidia.com/downloads/ngccli_cat_linux.zip && unzip ngccli_cat_linux.zip && rm ngccli_cat_linux.zip
RUN echo 'export PATH="$PATH:/opt/ngc-cli"' >> ~/.bashrc
# gcloud
# @see https://cloud.google.com/sdk/docs/install
RUN apt-get install -yq apt-transport-https ca-certificates gnupg
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
RUN apt-get update && apt-get install -yq google-cloud-cli
RUN ln -s /app/state/.gcp /root/.config/gcloud
RUN echo "mkdir -p /app/state/.gcp" >> /root/.bashrc
# alibaba cloud cli
# @see https://github.com/aliyun/aliyun-cli#installation
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/aliyun/aliyun-cli/HEAD/install.sh)"
RUN aliyun auto-completion
# aws cli
# @see https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
WORKDIR /tmp
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip
RUN ./aws/install
# copy app code into container
COPY . /app
# customoize bash prompt
RUN echo "export PS1='\[\033[01;36m\][Isaac Automator \${VERSION}]\[\033[00m\]:\w\$ '" >> /root/.bashrc
WORKDIR /app
ENTRYPOINT [ "/bin/sh", "-c" ]
ENV VERSION="v3.4.2"