0

enter image description hereDockerfile build successfly, however, I used ocker run -it --hostname hadoop1 --name hadoop hadoop_v1.0 and there was a try `chown --help' for more information,I checked all the logs under /usr/local/hadoop/logs and they all reported an error,The container can also run normally

This is a dockerfile for building hadoop. The chown command is used in the dockerfile in the following places:enter image description here

RUN chmod 600 ${ROOT_HOME}/.ssh/config && \
    chown root:root ${ROOT_HOME}/.ssh/config && \
    chown root:root /etc/bootstrap.sh && \
    chmod 700 /etc/bootstrap.sh && \
    chmod +x $HADOOP_HOME/etc/hadoop/*-env.sh && \
    adduser hdpuser && \
    echo 'hdpuser:hdppassword' | chpasswd && \
    usermod -aG wheel hdpuser && \
    echo "%wheel        ALL=(ALL)       ALL" >> /etc/sudoers

1 Answer 1

2

It's because USER env var is not set in docker which is used sbin/hadoop-daemon.sh script. But in the case of the hadoop you should set env var HADOOP_IDENT_STRING to the desired user, the one that is excuting process inside container.

See Docker why isn't $USER environment variable set

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.