forked from pnp/cli-microsoft365
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (40 loc) · 1.63 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
FROM mcr.microsoft.com/powershell:alpine-3.12
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 <[email protected]>, \
Velin Georgiev <[email protected]>, \
Garry Trinder <[email protected]>, \
Albert-Jan Schot <[email protected]>, \
Rabia Williams <[email protected]>, \
Patrick Lamber <[email protected]> \
Arjun Menon <[email protected]>" \
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 'npm cache clean --force' \
&& bash -c 'm365 cli completion sh setup' \
&& pwsh -c 'm365 cli completion pwsh setup --profile $profile'
RUN pip install jmespath-terminal
CMD [ "bash", "-l" ]