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

aws is not found inside the justb4/jmeter image container #7950

Closed
Amit-limbasiya opened this issue Jun 5, 2023 · 6 comments
Closed

aws is not found inside the justb4/jmeter image container #7950

Amit-limbasiya opened this issue Jun 5, 2023 · 6 comments
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. docker Issue involves the AWS CLI Docker container image

Comments

@Amit-limbasiya
Copy link

Amit-limbasiya commented Jun 5, 2023

Describe the bug

I am using the justb4/jmeter image to create the container.
I am modifying the justb4/jmeter image to add the aws-cli installation.
when I do docker-compose up and try to run the aws --version command it is showing error as aws not found.

In other approach that I've mentioned in additional information, I try to keep the justb4/jmeter image as it is and try to write the installation command in the script file which will run as entrypoint file. Still the output remains same, i.e. aws not found.

Expected Behavior

it should show the output of aws --version

Current Behavior

It is showing that aws not found.

Reproduction Steps

Here is the docker compose file.

version: '3.4'

services:
  jmeter:
    image: ${DOCKER_REGISTRY-}jmeter--customimage
    build:
      context: .
      dockerfile: JmeterImage/Dockerfile
    volumes: 
    - ./test-scripts:/jmeter/test-scripts
    - ./results:/jmeter/results

jmeter is the custom image that I have extended from justb4/jmeter image to install the aws-cli in it.
That image code is look like:

FROM justb4/jmeter:latest
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
    unzip awscliv2.zip && \
    ./aws/install && \
    rm awscliv2.zip 
ENTRYPOINT [ "aws.exe","--version" ]

Additional i have used services of my API and ms-sql-server in docker container.
It is showing outout as
exec /usr/local/bin/aws: no such file or directory.

I have navigated to that directory usr/local/bin/aws, there is the reference pointing to another reference and that is pointing to 3rd reference, that ends at usr/local/aws-cli/v2/bin/dist/aws
that is where the aws file stored.

Another approach

I have tried another approach where the image of justb4/jmeter is used as it is and i am running the script at the entrypoint which will download the aws-cli.
here is the compose file

  jmeter:
    image: justb4/jmeter:latest
    volumes: 
    - ./test-scripts:/jmeter/test-scripts
    - ./results:/jmeter/results

    entrypoint: ["sh", "-c","/jmeter/test-scripts/entrypoint.sh"]

And the entrypoint.sh script looks like:

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
    unzip awscliv2.zip && \
    ./aws/install && \
    rm awscliv2.zip
/usr/local/bin/aws --version

When the container starts it is downloading and installing aws in the container. I can see those files which i have mentioned in above reproduction steps.
Then after at the last line of installation logs it is showing as

You can now run: /usr/local/bin/aws --version

As i have run same command in the entrypoint.sh file, but It is showing error as

/usr/local/bin/aws: not found

at the end of the log.

Note:

same steps are running in wsl linux 20.04 LTS environment and prints the version. that shows it installed successfully.

CLI version used

trying to download aws-cli/2.11.25 Python/3.11.3 Linux/5.15.90.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off

Environment details (OS name and version, etc.)

docker-compose(Linux environment)

@Amit-limbasiya Amit-limbasiya added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 5, 2023
@tim-finnigan
Copy link
Contributor

Hi @Amit-limbasiya thanks for reaching out. It looks like a similar issue was reported here: #4971. Have you tried using Alpine Linux installation documented here: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-source-install.html?

@tim-finnigan tim-finnigan added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. docker Issue involves the AWS CLI Docker container image and removed needs-triage This issue or PR still needs to be triaged. labels Jun 8, 2023
@tim-finnigan tim-finnigan self-assigned this Jun 8, 2023
@tim-finnigan tim-finnigan removed the bug This issue is a bug. label Jun 8, 2023
@Amit-limbasiya
Copy link
Author

Thanks for answering @tim-finnigan. I think the awscli binaries are not competible with the alpine based image because it is compiled against the glibc compiler As per the comment on the existing issue 4685

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 9, 2023
@tim-finnigan
Copy link
Contributor

Hi @Amit-limbasiya thanks for following up. That comment you linked was from 2019, a more recent comment from a few months ago noted that the AWS CLI now has support for Alpine/libmusl. There is a section in this documentation for using an Alpine Linux container.

@tim-finnigan tim-finnigan added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 13, 2023
@Amit-limbasiya
Copy link
Author

Amit-limbasiya commented Jun 14, 2023

Hi @tim-finnigan Thanks for answering and letting me know about the AWS CLI support for Alpine. I was trying to add the aws support in the docker in which the base image is of justb4/jmeter. Additionally justb4/jmeter has its base image as alpine, thats why I've been in search of download the awscli in alpine based docker image. Anyway, Thank you for following up.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 14, 2023
@tim-finnigan
Copy link
Contributor

Thanks for following up again - for feature requests directly related to the justb4/jmeter image I think your best bet is to open an issue here in their repository: https://github.com/justb4/docker-jmeter

@tim-finnigan tim-finnigan added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jun 19, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. docker Issue involves the AWS CLI Docker container image
Projects
None yet
Development

No branches or pull requests

2 participants