diff --git a/.dockerfilelintrc b/.dockerfilelintrc new file mode 100644 index 00000000000..c05f419dcd6 --- /dev/null +++ b/.dockerfilelintrc @@ -0,0 +1,104 @@ +--- +########################### +########################### +## Dockerfile Lint rules ## +########################### +########################### + +################################# +# Default is 'on' for all rules # +# You can disable as needed. # +################################# +# Additional Info can be found at: +# https://github.com/replicatedhq/dockerfilelint + +# Set the rules +rules: + # All commands in a Dockerfile require at least 1 argument + required_params: on + + # For clarity and readability, all instructions in + # a Dockerfile should be uppercase + uppercase_commands: on + + # The first instruction in a Dockerfile must specify + # the base image using a FROM + from_first: on + + # This line is not a valid Dockerfile line + invalid_line: on + + # Use of sudo is not allowed in a Dockerfile + sudo_usage: on + + # Consider using a `--no-install-recommends` when `apt-get` + # installing packages + apt-get_missing_param: on + + # Consider using a `--no-install-recommends` when `apt-get` + # installing packages + apt-get_recommends: off + + # Use of `apt-get upgrade` is not allowed in a Dockerfile + apt-get-upgrade: on + + # Use of `apt-get dist-upgrade` is not allowed in a Dockerfile + apt-get-dist-upgrade: on + + # All instances of `apt-get update` should have the `apt-get install` + # commands on the same line to reduce image size + apt-get-update_require_install: on + + # Consider using a `--no-cache` (supported in alpine linux >= 3.3) or + # `--update` followed by the command `rm -rf /var/cache/apk/*` + # when `apk` adding packages. This will result in a smaller image size + apkadd-missing_nocache_or_updaterm: on + + # Consider using a `--virtual` or `-t` switch to group multiple packages + # for easy cleanup. This will help ensure future authors will continue + # to clean up build dependencies and other temporary packages + apkadd-missing-virtual: on + + # Exposing ports should only be valid port numbers + invalid_port: on + + # Only valid commands are allowed in a Dockerfile + invalid_command: on + + # Expose Only Container Port + expose_host_port: on + + # Using LABEL should be in key=value format + label_invalid: on + + # Base images should specify a tag to use + missing_tag: on + + # Base images should not use the latest tag + latest_tag: off + + # This command has extra arguments and will be ignored + extra_args: on + + # This command requires additional arguments + missing_args: on + + # All files referenced in an ADD command should + # be part of the Docker build context + add_src_invalid: on + + # When adding multiple files, the destination should be a directory + add_dest_invalid: on + + # Using a WORKDIR parameter that has spaces should be escaped + invalid_workdir: on + + # The arguments to this command are invalid + invalid_format: on + + # Use of apt-get update should be paired with + # rm -rf /var/lib/apt/lists/* in the same layer + apt-get_missing_rm: on + + # This INSTRUCTION is deprecated as of Docker 1.13 + deprecated_in_1.13: on diff --git a/docker/ubuntu-16.04/Dockerfile b/docker/ubuntu-16.04/Dockerfile index d4f2415d35f..cc5704abc4a 100644 --- a/docker/ubuntu-16.04/Dockerfile +++ b/docker/ubuntu-16.04/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:16.04 RUN cat /etc/lsb-release RUN apt-get -u update \ - && apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng12-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew1.5-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev docbook-xsl xsltproc asciidoc gettext git cmake sudo libcurl4-gnutls-dev gnutls-dev \ + && apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng12-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew1.5-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev docbook-xsl xsltproc asciidoc gettext git cmake libcurl4-gnutls-dev gnutls-dev \ && rm -rf /var/lib/apt/lists/* # Download, build, & install SDL 2.0.5 from source @@ -18,7 +18,7 @@ RUN echo "$SDL2_SHA256 /tmp/SDL2-2.0.5.tar.gz" | sha256sum -c \ && cd build \ && ../configure --enable-mir-shared=no \ && make \ - && sudo make install \ + && make install \ && cd /tmp \ && rm -rf /tmp/SDL2-2.0.5 @@ -33,7 +33,7 @@ RUN echo "$SODIUM_SHA256 /tmp/libsodium-1.0.18.tar.gz" | sha256sum -c \ && cd build \ && ../configure \ && make && make check \ - && sudo make install \ + && make install \ && cd /tmp \ && rm -rf /tmp/libsodium-1.0.18 diff --git a/docker/ubuntu-18.04/Dockerfile b/docker/ubuntu-18.04/Dockerfile index a1a9392f2dc..2f308054b64 100644 --- a/docker/ubuntu-18.04/Dockerfile +++ b/docker/ubuntu-18.04/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:18.04 RUN cat /etc/lsb-release RUN apt-get -u update \ - && DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev docbook-xsl xsltproc asciidoc gettext git cmake sudo libcurl4-gnutls-dev gnutls-dev libsodium-dev \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev docbook-xsl xsltproc asciidoc gettext git cmake libcurl4-gnutls-dev gnutls-dev libsodium-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /code diff --git a/docker/ubuntu-18.04/Dockerfile.arm64 b/docker/ubuntu-18.04/Dockerfile.arm64 index ba6157e445e..d3de3bd9062 100644 --- a/docker/ubuntu-18.04/Dockerfile.arm64 +++ b/docker/ubuntu-18.04/Dockerfile.arm64 @@ -3,7 +3,7 @@ FROM arm64v8/ubuntu:18.04 RUN cat /etc/lsb-release RUN apt-get -u update \ - && DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev docbook-xsl xsltproc asciidoc gettext git cmake sudo libcurl4-gnutls-dev gnutls-dev libsodium-dev \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev docbook-xsl xsltproc asciidoc gettext git cmake libcurl4-gnutls-dev gnutls-dev libsodium-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /code diff --git a/docker/ubuntu-20.04/Dockerfile b/docker/ubuntu-20.04/Dockerfile index d9b1660d326..ba92297b075 100644 --- a/docker/ubuntu-20.04/Dockerfile +++ b/docker/ubuntu-20.04/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:20.04 RUN cat /etc/lsb-release RUN apt-get -u update \ - && DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev asciidoctor gettext git cmake sudo libcurl4-gnutls-dev gnutls-dev libsodium-dev \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev asciidoctor gettext git cmake libcurl4-gnutls-dev gnutls-dev libsodium-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /code diff --git a/docker/ubuntu-20.04/Dockerfile.arm64 b/docker/ubuntu-20.04/Dockerfile.arm64 index d396c8b8b9c..f382ea95582 100644 --- a/docker/ubuntu-20.04/Dockerfile.arm64 +++ b/docker/ubuntu-20.04/Dockerfile.arm64 @@ -3,7 +3,7 @@ FROM arm64v8/ubuntu:20.04 RUN cat /etc/lsb-release RUN apt-get -u update \ - && DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev asciidoctor gettext git cmake sudo libcurl4-gnutls-dev gnutls-dev libsodium-dev \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install gcc g++ clang libc-dev dpkg-dev ninja-build pkg-config libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libglew-dev libxrandr-dev zip unzip qtscript5-dev qt5-default libfribidi-dev libfreetype6-dev libharfbuzz-dev libfontconfig1-dev asciidoctor gettext git cmake libcurl4-gnutls-dev gnutls-dev libsodium-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /code