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

Bug: docker: invalid reference format: repository name must be lowercase. #107

Open
2 tasks done
Fennerr opened this issue Sep 27, 2024 · 0 comments
Open
2 tasks done

Comments

@Fennerr
Copy link

Fennerr commented Sep 27, 2024

Commit hash:

* main 4ab85a2 [origin/main] Merge pull request #105 from awslabs/feat/asharp-model
  • Installation/Running method:
    • Git clone
  • Operating System:
    • Linux

Describe the bug
When trying to run ash against a repo which has a space in the path, the space is not appropriately handled which results in the following docker error:

Step 54/54 : CMD [ "ash" ]
 ---> Using cache
 ---> 9eff7d62eb48
Successfully built 9eff7d62eb48
Successfully tagged automated-security-helper:local
Running ASH scan using built image...
docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.

Running with debug showed that the issue was introduced when the path was being added to the mount directory

...
Running ASH scan using built image...
+ eval /usr/bin/docker run --rm -e 'ACTUAL_SOURCE_DIR=/media/psf/Folder With A Space/repo' -e ASH_DEBUG=YES -e ASH_OUTPUT_FORMAT=text --mount type=bind,source=/media/psf/Folder With A Space/repo,destination=/src,readonly --mount type=bind,source=/tmp,destination=/out --network=none automated-security-helper:local ash --source-dir /src --output-dir /out
++ /usr/bin/docker run --rm -e ACTUAL_SOURCE_DIR=/media/psf/Folder With A Space/repo -e ASH_DEBUG=YES -e ASH_OUTPUT_FORMAT=text --mount type=bind,source=/media/psf/Folder With A Space/repo,destination=/src,readonly --mount type=bind,source=/tmp,destination=/out --network=none automated-security-helper:local ash --source-dir /src --output-dir /out
docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.
+ RC=125
+ [[ YES = \Y\E\S ]]
+ set +x

Work Around
Moving the repo to /tmp, so that it doesnt have a space in the path, resulted in the tool working.

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