Docker Community Forums

Share and learn in the Docker community.

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

build
docker

(Shriyashlakhe) #1

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 shriyash

ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH

RUN mkdir -p “$CATALINA_HOME”

WORKDIR $CATALINA_HOME

COPY tomcat $CATALINA_HOME

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

ADD apache-ant-1.7.0 /usr/local/ant
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
shriyash


(Sam) #2

you cannot… the container has no UI… and it cannot prompt back to the host…

the only way to do this, with prompts, is start the container with -it and then launch the ant build manually to answer the prompts…

a better way is to start the container with the answers already and drive the build that way, automated


(Shriyashlakhe) #3

Hi,

Thanks for your response…

I was meant to say “Is there a way to allow user interaction during the build process by prompting for input when use ant tool using Docker” so Is your answer for this same
"you cannot… the container has no UI… and it cannot prompt back to the host…"

Basically my requirement is to pick up the property file from specified location of my project as per inputted value whilst building application via ant tool using Docker…So if Docker doesn’t support this than can anyone let me know how we can achieve this by plugging something with Docker.

Regards,
Shriyash


(Sam) #4

you can build a script around docker run to put the right file inthe right place, and have the ant build in docker pick it up