• [^] # Re: Dockerfile

    Posté par (site web personnel) . En réponse au journal FusionForge & Docker. Évalué à 5. Dernière modification le 14 juin 2017 à 11:31.

    Il y a une erreur dans le (mon) Dockerfile :

    RUN set -x \
     && source ./autoinstall/common-backports \
     && yum install -y \
     make \
     tar \
     && backports_rpm \
    

    La commande backports_rpm était passée à la trape.

    Il reste une question dans ce dockerfile, c'est l'update du début. Logiquement l'image docker de base devrait être à jour, c'est le principe tout de même.
    Je l'ai supprimée pour être ok vis à vis du linter, mais ça reste un choix.

    Et la sortie des linters:

    $ docker run --rm -it --privileged -v $PWD:/root/ projectatomic/dockerfile-lint dockerfile_lint lint
    -------WARNINGS--------
    Line 7: -> RUN yum -y install git openssh-server; yum clean all
    WARNING: installing SSH in a container is not recommended. Do you really need SSH in this image?. 
    Reference -> https://github.com/jpetazzo/nsenter
    
    $ docker run --rm -i sjourdan/hadolint < Dockerfile
    /dev/stdin:13 SC1091 Not following: File not included in mock.
    /dev/stdin:75 DL3002 Do not switch to root USER