forked from pnp/cli-microsoft365
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (45 loc) · 1.93 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
FROM mcr.microsoft.com/powershell:alpine-3.17
ARG CLI_VERSION=latest
LABEL name="m365pnp/cli-microsoft365:${CLI_VERSION}" \
description="Manage Microsoft 365 and SharePoint Framework projects on any platform" \
homepage="https://pnp.github.io/cli-microsoft365" \
maintainers="Waldek Mastykarz <waldek@mastykarz.nl>, \
Garry Trinder <garry.trinder@live.com>, \
Albert-Jan Schot <appie@digiwijs.nl>, \
Arjun Menon <arjun.umenon@gmail.com>, \
Adam Wojcik <adam.wojcik.it@gmail.com>, \
Martin Lingstuyl <mlingstuyl@live.com>, \
Jasey Waegebaert <jaseyw@gmigroup.be>, \
Milan Holemans <Milan.Holemans@vanroey.be>" \
com.azure.dev.pipelines.agent.handler.node.path="/usr/bin/node"
RUN apk add --no-cache \
curl \
sudo \
bash \
shadow \
bash-completion \
nodejs \
npm \
python3 \
py3-pip
RUN adduser --system cli-microsoft365
USER cli-microsoft365
WORKDIR /home/cli-microsoft365
ENV 0="/bin/bash" \
SHELL="bash" \
NPM_CONFIG_PREFIX=/home/cli-microsoft365/.npm-global \
PATH=$PATH:/home/cli-microsoft365/.npm-global/bin:/home/cli-microsoft365/.local/bin \
CLIMICROSOFT365_ENV="docker"
RUN bash -c 'echo "export PATH=$PATH:/home/cli-microsoft365/.npm-global/bin:/home/.local/bin" >> ~/.bash_profile' \
&& bash -c 'echo "export CLIMICROSOFT365_ENV=\"docker\"" >> ~/.bash_profile' \
&& bash -c 'npm i -g @pnp/cli-microsoft365@${CLI_VERSION} --production --quiet --no-progress' \
&& bash -c 'echo "source /etc/profile.d/bash_completion.sh" >> ~/.bash_profile' \
&& bash -c 'echo "alias \"m365?\"=\"m365_chili\"" >> ~/.bash_profile' \
&& bash -c 'echo ". .bashrc" >> ~/.bash_profile' \
&& bash -c 'npm cache clean --force' \
&& bash -c 'm365 cli completion sh setup' \
&& pwsh -c 'm365 cli completion pwsh setup --profile $profile' \
&& pwsh -c 'Add-Content -Path $PROFILE -Value "`r`Set-Alias -Name m365? -Value m365_chili"'
RUN pip install setuptools==58
RUN pip install jmespath-terminal
CMD [ "bash", "-l" ]