ANT build tool inside Docker file can not ask option as input at console but ANT ask option without docker

Hi, we are using ANT build tool to build our application, our build.xml script file have multiple input parameter when we ran ANT then it asks multiple times yes/no questions… But same application we build using docker file then it do not ask any question. Please see my dockerfile sample below:

FROM openjdk:6


ENV CATALINA_HOME /usr/local/tomcat


# Tomcat folder creation inside Docker container

ENV ANT_HOME /usr/local/ant
ENV PATH ${PATH}:/usr/local/ant/bin

# Added ANT tool from host to docker container
ADD apache-ant-1.7.0 /usr/local/ant

# Added application from host to docker container
# TempProject contains build.xml , src and webroot
ADD TempProject /usr/local/TempProject  

WORKDIR /usr/local/TempProject 

RUN ant

so when ANT run inside docker file then it do not ask any question at console whereas in normal it asks.

we are using docker build command as below to build application (it makes images) docker build --tag=myApp .

Please guide us in which way we can get console input for images.

Thanks Rama

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there @ramas,

What I would suggest here is changing the last line from:

RUN ant

To the following:

CMD ant

That way the command would be run during the initialization of the Docker container and not while building the image. That way you should have better control over the parameters that are specified.

Regards, Bobby