I use Docker to build an image and within that image, I have a .exp
file I run to authorise the installation of some software which requires user input in the terminal.
When I send a value after using send
nothing is printed in the command line window when building the image, the value sent is empty. Any help is much appreciated I would really like to get to the bottom of this quickly.
Dockerfile
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
COPY bin/Release/netcoreapp3.1/ App/
COPY bin/Release/netcoreapp3.1/expressvpn.exp /
WORKDIR /App
RUN /bin/bash -c "apt update"
RUN apt-get install ./expressvpn_2.5.0.505-1_amd64.deb -y && apt-get install sudo -y && apt-get install expect -y
WORKDIR ..
RUN expect ./expressvpn.exp
ENTRYPOINT ["dotnet", "TestingApp.dll"]
expressvpn.exp
#!/usr/bin/expect -d
spawn expressvpn activate
expect "code:"
send "someactivationcode\r"
expect "information."
send "n\r"
expect eof
Powershell output
spawn expressvpn activate
Enter activation code:
Activating...
Unable to sign in. Please check your connection and try again.
send: spawn id exp3 not open
while executing
"send "n\r""
(file "./expressvpn.exp" line 9)
'someactivationcode' should be printed where 'Enter activation code"' appears but instead it is empty.