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

Add support for containers with no entrypoint/cmd #2173

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mbrancato
Copy link

@mbrancato mbrancato commented Nov 3, 2024

The API call to create a docker image (e.g. the docker command docker create) does not support creating a non-running container with no entrypoint or command specified. This will cause oscap-docker to fail with the HTTP 400 error from the Docker service:

docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.45/containers/create: Bad Request 
("no command specified")

To solve this, for scanning purposes only, pass a null character as the explicit command for all containers.

An example Dockerfile for a container with no command is below. it is much more command for container images designed to be used as a base container to have no command as they are not intended to be run directly.

FROM scratch
COPY . /

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

Successfully merging this pull request may close these issues.

1 participant