diff --git a/tools/autorest/Dockerfile b/tools/autorest/Dockerfile new file mode 100644 index 000000000000..9a4239ccbdde --- /dev/null +++ b/tools/autorest/Dockerfile @@ -0,0 +1,21 @@ +FROM mcr.microsoft.com/powershell:7.1.3-ubuntu-18.04 + +# Install dependencies and clean up +RUN apt-get update \ + && apt-get install -y curl \ + && curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \ + && . /root/.bashrc \ + && nvm install 14.15.5 \ + && npm config set unsafe-perm true \ + && npm install -g autorest \ + && npm install -g dotnet-sdk-2.1 \ + && apt-get -o Acquire::Check-Valid-Until=false install -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && locale-gen $LANG && update-locale + +RUN mkdir -p /src + +WORKDIR /src + +CMD [ "bash" ] diff --git a/tools/autorest/readme.md b/tools/autorest/readme.md new file mode 100644 index 000000000000..58189e07881b --- /dev/null +++ b/tools/autorest/readme.md @@ -0,0 +1,22 @@ +# All-in-One Docker Image for Azure PowerShell Code Generation +Packages contained in the image. +* PowerShell 6.2.4 +* NodeJS 14.15.5 +* Latest autorest +* Dotnet SDK 2.1 + +# How to Build the Image +`docker build -t autorest ./` + +# Launch the Image +`docker run -it -v :/src autorest` + +# Code Generation vs Build vs Run +## Code Generation +`autorest` +## Build +`pwsh build-module.ps1` +## Run +`pwsh run-module.ps1` +## Playback Test +`pwsh test-module.ps1`