Skip to content

Commit f7d326d

Browse files
authored
Merge pull request #482 from surajssd/move-few-tools-to-base
Move few tools to base-image to reduce tools img size
2 parents db38fc9 + bc865b6 commit f7d326d

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

linux/base.Dockerfile

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ RUN chmod 755 /usr/local/bin/ansible* \
155155
&& /bin/bash -c "source ansible/bin/activate && pip3 list --outdated --format=freeze | cut -d '=' -f1 | xargs -n1 pip3 install -U && pip3 install ansible && pip3 install pywinrm\>\=0\.2\.2 && deactivate" \
156156
&& rm -rf ~/.local/share/virtualenv/ \
157157
&& rm -rf ~/.cache/pip/ \
158-
&& ansible-galaxy collection install azure.azcollection --force -p /usr/share/ansible/collections
158+
&& ansible-galaxy collection install azure.azcollection --force -p /usr/share/ansible/collections \
159+
# Temp: Proper fix is to use regular python for Ansible.
160+
&& mkdir -p /usr/share/ansible/collections/ansible_collections/azure/azcollection/ \
161+
&& wget -nv -q -O /usr/share/ansible/collections/ansible_collections/azure/azcollection/requirements.txt https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements.txt \
162+
&& /opt/ansible/bin/python -m pip install -r /usr/share/ansible/collections/ansible_collections/azure/azcollection/requirements.txt
163+
159164

160165
# Install latest version of Istio
161166
ENV ISTIO_ROOT /usr/local/istio-latest
@@ -177,3 +182,30 @@ RUN gem install bundler --no-document --clear-sources --force \
177182
ENV GEM_HOME=~/bundle
178183
ENV BUNDLE_PATH=~/bundle
179184
ENV PATH=$PATH:$GEM_HOME/bin:$BUNDLE_PATH/gems/bin
185+
186+
# Install vscode
187+
RUN wget -nv -O vscode.tar.gz "https://code.visualstudio.com/sha/download?build=insider&os=cli-alpine-x64" \
188+
&& tar -xvzf vscode.tar.gz \
189+
&& mv ./code-insiders /bin/vscode \
190+
&& rm vscode.tar.gz
191+
192+
# Install azure-developer-cli (azd)
193+
ENV AZD_IN_CLOUDSHELL=1 \
194+
AZD_SKIP_UPDATE_CHECK=1
195+
RUN curl -fsSL https://aka.ms/install-azd.sh | bash && \
196+
#
197+
# Install Office 365 CLI templates
198+
#
199+
npm install -q -g @pnp/cli-microsoft365 && \
200+
#
201+
# Install Bicep CLI
202+
#
203+
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 \
204+
&& chmod +x ./bicep \
205+
&& mv ./bicep /usr/local/bin/bicep \
206+
&& bicep --help && \
207+
#
208+
# Add soft links
209+
#
210+
ln -s /usr/bin/python3 /usr/bin/python && \
211+
ln -s /usr/bin/node /usr/bin/nodejs

linux/tools.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ RUN /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Base && \
7878
RUN rm -f ./linux/Dockerfile && rm -f /bin/su
7979

8080
#Add soft links
81-
RUN ln -s /usr/bin/python3 /usr/bin/python
82-
RUN ln -s /usr/bin/node /usr/bin/nodejs
81+
RUN ln -sf /usr/bin/python3 /usr/bin/python
82+
RUN ln -sf /usr/bin/node /usr/bin/nodejs
8383

8484
# Add user's home directories to PATH at the front so they can install tools which
8585
# override defaults

0 commit comments

Comments
 (0)