Skip to content

Commit 4fc53c7

Browse files
authored
autorest powershell docker file into auzre powershell repo (#18442)
1 parent e040dbe commit 4fc53c7

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

tools/autorest/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM mcr.microsoft.com/powershell:7.1.3-ubuntu-18.04
2+
3+
# Install dependencies and clean up
4+
RUN apt-get update \
5+
&& apt-get install -y curl \
6+
&& curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
7+
&& . /root/.bashrc \
8+
&& nvm install 14.15.5 \
9+
&& npm config set unsafe-perm true \
10+
&& npm install -g autorest \
11+
&& npm install -g dotnet-sdk-2.1 \
12+
&& apt-get -o Acquire::Check-Valid-Until=false install -y \
13+
&& apt-get clean \
14+
&& rm -rf /var/lib/apt/lists/* \
15+
&& locale-gen $LANG && update-locale
16+
17+
RUN mkdir -p /src
18+
19+
WORKDIR /src
20+
21+
CMD [ "bash" ]

tools/autorest/readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# All-in-One Docker Image for Azure PowerShell Code Generation
2+
Packages contained in the image.
3+
* PowerShell 6.2.4
4+
* NodeJS 14.15.5
5+
* Latest autorest
6+
* Dotnet SDK 2.1
7+
8+
# How to Build the Image
9+
`docker build -t autorest ./`
10+
11+
# Launch the Image
12+
`docker run -it -v <path-to-your-source>:/src autorest`
13+
14+
# Code Generation vs Build vs Run
15+
## Code Generation
16+
`autorest`
17+
## Build
18+
`pwsh build-module.ps1`
19+
## Run
20+
`pwsh run-module.ps1`
21+
## Playback Test
22+
`pwsh test-module.ps1`

0 commit comments

Comments
 (0)