forked from pnp/cli-microsoft365
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (38 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
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 <waldek@mastykarz.nl>, \
Velin Georgiev <velin.georgiev@gmail.com>, \
Garry Trinder <garry.trinder@live.com>, \
Albert-Jan Schot <appie@digiwijs.nl>, \
Rabia Williams <rabiawilliams@gmail.com>, \
Patrick Lamber <patrick@nubo.eu> \
Arjun Menon <arjun.umenon@gmail.com>" \
com.azure.dev.pipelines.agent.handler.node.path="/usr/bin/node"
RUN apk add --no-cache \
curl \
sudo \
bash \
shadow \
bash-completion \
nodejs \
npm
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 \
CLIMICROSOFT365_ENV="docker"
RUN bash -c 'echo "export PATH=$PATH:/home/cli-microsoft365/.npm-global/bin" >> ~/.bash_profile' \
&& bash -c 'echo "export NPM_CONFIG_PREFIX=/home/cli-microsoft365/.npm-global" >> ~/.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'
CMD [ "bash", "-l" ]