1

I am trying to run the below command over an alpine image in my docker file:

I have powershell installed and trying to get chocolatey through powershell commands.

RUN pwsh -c Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

and running into this error

/bin/bash: -c: line 0: syntax error near unexpected token `('

I also tried including the below and ran into the same issue.

SHELL ["/bin/bash", "-c"] \
RUN shopt -s extglob
1
  • 1
    Enclose everything after -c in '...', and use "..." around the URL. Commented Aug 20, 2020 at 3:40

1 Answer 1

0

You are missing '

RUN pwsh -c 'Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString("https://chocolatey.org/install.ps1"))'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.