By ramas
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
MAINTAINER Rama
ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH
RUN mkdir -p "$CATALINA_HOME"
WORKDIR $CATALINA_HOME
# Tomcat folder creation inside Docker container
COPY tomcat $CATALINA_HOME
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
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.