Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default behaviour tries to start /bin/sh in Windows Containers #16

Closed
tedsmitt opened this issue Apr 8, 2022 · 0 comments · Fixed by #17
Closed

Default behaviour tries to start /bin/sh in Windows Containers #16

tedsmitt opened this issue Apr 8, 2022 · 0 comments · Fixed by #17
Labels
bug Something isn't working

Comments

@tedsmitt
Copy link
Owner

tedsmitt commented Apr 8, 2022

With the addition of https://aws.amazon.com/about-aws/whats-new/2022/04/amazon-commands-windows-container-aws-fargate/

When attempting to start a session on a Windows Container you'll get the following error

>> ~/.../github/ecsgo (main) [edintheclouds-dev] $ ecsgo
? Select a task: 
Cluster: bluegreen | Service: * | Task: 78619b12e30f4652a20c1ce840f2bf60
Connecting to container windows_container
Starting session with SessionId: ecs-execute-command-057be7bbf24366b94
/bin/sh : The term '/bin/sh' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or 
if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ /bin/sh
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (/bin/sh:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

This can be worked around by specifying the command powershell.exe when using the tool

e.g. ecsgo -c powershell.exe

Will look at adding a check to see what the OS family is, and then decide the default command based on that information.

There also seems to be an empty space that gets printed to stdout so need to look into that as well if possible. (This happens when using the AWS CLI as well)

@tedsmitt tedsmitt added the bug Something isn't working label Apr 8, 2022
@tedsmitt tedsmitt closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant