# Docker: Override ENTRYPOINT

In this entry, we go over common mistakes when we try to override ENTRYPOINT in a Docker image and how to do it properly.

### Problem description

The docker image for JNLP-based Jenkins agent requires us to pass a few arguments. Simply running such docker image will give the following error:

Most of the error messages above is from Jenkins binary slave.jar and has nothing to do with Docker. To make the container run on Docker, we must override its ENTRYPOINT at runtime to provide the arguments required. However, one common mistake while trying to override is as follows:

Except for passing argument to the ENTRYPOINT, the Docker image is usually the last parameter. Another attempt to make it “right” is as follows:

This attempt try to put the entire overridden command as the parameter for “–entrypoint” flag. However, this does NOT work because, as stated in documentation, the entrypoint should specify the executable, not the command. The correct way to do it is as follows:

As seeen above, the executable is passed into “–entrypoint” flag, while its arguments are being passed after the image name.