Skip to content

Commit

Permalink
Merge pull request #482 from surajssd/move-few-tools-to-base
Browse files Browse the repository at this point in the history
Move few tools to base-image to reduce tools img size
  • Loading branch information
surajssd authored Aug 29, 2024
2 parents db38fc9 + bc865b6 commit f7d326d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
34 changes: 33 additions & 1 deletion linux/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ RUN chmod 755 /usr/local/bin/ansible* \
&& /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" \
&& rm -rf ~/.local/share/virtualenv/ \
&& rm -rf ~/.cache/pip/ \
&& ansible-galaxy collection install azure.azcollection --force -p /usr/share/ansible/collections
&& ansible-galaxy collection install azure.azcollection --force -p /usr/share/ansible/collections \
# Temp: Proper fix is to use regular python for Ansible.
&& mkdir -p /usr/share/ansible/collections/ansible_collections/azure/azcollection/ \
&& wget -nv -q -O /usr/share/ansible/collections/ansible_collections/azure/azcollection/requirements.txt https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements.txt \
&& /opt/ansible/bin/python -m pip install -r /usr/share/ansible/collections/ansible_collections/azure/azcollection/requirements.txt


# Install latest version of Istio
ENV ISTIO_ROOT /usr/local/istio-latest

Check warning on line 166 in linux/base.Dockerfile

View workflow job for this annotation

GitHub Actions / build_and_push

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
Expand All @@ -177,3 +182,30 @@ RUN gem install bundler --no-document --clear-sources --force \
ENV GEM_HOME=~/bundle
ENV BUNDLE_PATH=~/bundle
ENV PATH=$PATH:$GEM_HOME/bin:$BUNDLE_PATH/gems/bin

# Install vscode
RUN wget -nv -O vscode.tar.gz "https://code.visualstudio.com/sha/download?build=insider&os=cli-alpine-x64" \
&& tar -xvzf vscode.tar.gz \
&& mv ./code-insiders /bin/vscode \
&& rm vscode.tar.gz

# Install azure-developer-cli (azd)
ENV AZD_IN_CLOUDSHELL=1 \
AZD_SKIP_UPDATE_CHECK=1
RUN curl -fsSL https://aka.ms/install-azd.sh | bash && \
#
# Install Office 365 CLI templates
#
npm install -q -g @pnp/cli-microsoft365 && \
#
# Install Bicep CLI
#
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 \
&& chmod +x ./bicep \
&& mv ./bicep /usr/local/bin/bicep \
&& bicep --help && \
#
# Add soft links
#
ln -s /usr/bin/python3 /usr/bin/python && \
ln -s /usr/bin/node /usr/bin/nodejs
4 changes: 2 additions & 2 deletions linux/tools.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ RUN /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Base && \
RUN rm -f ./linux/Dockerfile && rm -f /bin/su

#Add soft links
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN ln -s /usr/bin/node /usr/bin/nodejs
RUN ln -sf /usr/bin/python3 /usr/bin/python
RUN ln -sf /usr/bin/node /usr/bin/nodejs

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

0 comments on commit f7d326d

Please sign in to comment.