[ECS] [Launch command flexibility]: ECS will stat the whole command string as if it were a file
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
I would like to use a launch command that is not just a file path. For instance:
```sudo -u service_user /opt/service/launch_service.sh```
Or even better:
Working Directory: /opt/service
```sudo -u service_user ./launch_service.sh```
Currently, the working directory doesn't seem to be taken into account when coming up with the path to check.
Right now, this will fail with an error message telling me that it tried to stat "sudo -u service_user ./launch_service.sh" and no such file was found.
If I run a docker container normally with
```docker run -w /opt/service my_container sudo -u service_user ./launch_service.sh```
this will work just fine.
**Which service(s) is this request for?**
ECS
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
What outcome are you trying to achieve, ultimately, and why is it hard/impossible to do right now?
I would like to idiomatically launch a container.
What is the impact of not having this problem solved? The more details you can provide, the better we'll be able to understand and solve the problem.
This will result in a much less confusing experience for someone familiar with docker trying to set up an ECS task.
**Are you currently working around this issue?** Yes
How are you currently solving this problem?
I am having to install a script to do this instead, and rebuild all of my containers to contain this script.
Contributor guide
Research direction
Start by reviewing how ECS handles task command strings, working directories, and executable-path validation. Reproduce the reported failure with a command such as `sudo -u service_user ./launch_service.sh` and compare it with the Docker behavior described in the issue. Done means ECS can launch the command without treating the entire command string as a file path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker, shell
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100