Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build docker image fail : Exiting on user command

The Dockerfile is as fellow:

FROM centos:latest

RUN yum install git \
    nginx && \
    pip install uwsgi \

The result of executing docker build command build

When using yum install pakage, we maybe make choice like this "Is this ok [y/d/N]", I can inter "y" easily in the terminal. But how can I select the choice when I build an image with the Dockerfile ? Thanks a lot!

like image 282
xander-ye Avatar asked Jun 23 '17 07:06

xander-ye


1 Answers

Simply add -y to yum.

Example:

RUN yum -y install git ...
like image 86
Henry Avatar answered Oct 10 '22 19:10

Henry