问题
I am trying to create Docker
image by next Dockerfile
. It must to install Kerberos
client.
Dockerfile:
FROM node:latest
RUN export DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update
RUN apt-get -qq install krb5-user libpam-krb5
RUN apt-get -qq clean
COPY / ./
EXPOSE 3000
CMD ["npm", "start"]
Next command RUN apt-get -qq install krb5-user libpam-krb5
from Dockerfile ask me to enter the value to interactive prompt which looks like:
Default Kerberos version 5 realm:
The point is that the command does not terminate even if I write value and press enter. Whats wrong and how to fix it?
回答1:
You need a -y
parameter for apt
FROM node:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update && \
apt-get -yqq install krb5-user libpam-krb5 && \
apt-get -yqq clean
COPY / ./
EXPOSE 3000
CMD ["npm", "start"]
And remember, that each RUN
directive create one additional layer in the image, so it will be nice to reduce the amount of this directives.
来源:https://stackoverflow.com/questions/55572477/how-to-install-kerberos-client-in-docker