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

Can you show an example of calling aws curl from using the docker container that returns an error code to the calling process please? #190

Closed
preetmyob opened this issue Nov 20, 2023 · 1 comment

Comments

@preetmyob
Copy link

preetmyob commented Nov 20, 2023

Scenario: I'm running awscurl to validate that I've deployed my APIs correctly and that have a simple version endpoint that should return some info if called with a GET

docker run --rm \
    -ti \
    -v "$HOME/.aws:/root/.aws" \
    -e AWS_ACCESS_KEY_ID \
    -e AWS_SECRET_ACCESS_KEY \
    -e AWS_SECURITY_TOKEN \
    -e AWS_PROFILE \
    -e AWS_REGION \
    "okigan/awscurl:$image_version" \
    https://some-domain/api/servicename/version

Problem: I don't know how to get an error code if the domain return something other than 200.

Solution: I'd like to get either a binary passed/failed, or more ideally the status code of the call

@preetmyob
Copy link
Author

preetmyob commented Nov 27, 2023

It's ok I've worked it out:

you can use

docker container inspect nnnn --format={{.State.ExitCode}} where nnnn is the exited container id, or just use the exit code from bash echo $?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant