Dhruv Pandey
Dhruv Pandey

Reputation: 514

Install ant on Docker container

I have a running Jenkins container on Docker. But when I build a job in Jenkins it gives the following error:

ant: not found

I referred to following question Ant not working with Jenkins within a Docker container but this also didn't worked.

Then I tried running ANT using

docker run -p 8084:8084 --name=ant-on-docker webratio/ant

but this also gives the same error that ant is not found.

Upvotes: 0

Views: 4158

Answers (1)

Dhruv Pandey
Dhruv Pandey

Reputation: 514

Finally after a day, find a solution by myself. Issue was the container did't had access to the ant. So good to know these things:

  1. Check the $PATH variable inside the container. If that is not having ant, you need to add. And more important your host machine ant is not accessible to container. If you want to access host ant, mount your container over the host directory and copy the ant tool inside there.(this is what i did)
  2. I had portainer installed on my docker(it's a good UI for docker). So I went to the container and added the ant tool path to $PATH variable.

Upvotes: 3

Related Questions