From d368ee5273a795d19cd64a88a5713f63391b641a Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Tue, 30 Jul 2019 09:26:36 -0400 Subject: [PATCH] Follow some Docker best practices - Add a .dockerignore - Use "LABEL maintainer" instead of "MAINTAINER" - Only install pip if it doesn't already exist --- .dockerignore | 9 +++++++++ docker_utils/Dockerfile | 2 +- install.sh | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..f64fce4b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.git +.gitignore +.dockerignore +docker-compose.yml +docs/ +multiscanner/tests/ +.pre-commit-config.yaml +tox.ini +.travis.yml diff --git a/docker_utils/Dockerfile b/docker_utils/Dockerfile index b1284f1e..f9b01f76 100644 --- a/docker_utils/Dockerfile +++ b/docker_utils/Dockerfile @@ -1,5 +1,5 @@ FROM alpine -MAINTAINER Patrick Copeland ptcnop +LABEL maintainer="Patrick Copeland ptcnop" ENV YARA_VERSION 3.8.1 ENV YARA_PY_VERSION 3.8.1 diff --git a/install.sh b/install.sh index f6b80748..889796a0 100755 --- a/install.sh +++ b/install.sh @@ -19,7 +19,9 @@ if [ -e /etc/debian_version ]; then fi # Install multiscanner library and dependencies -curl -k https://bootstrap.pypa.io/get-pip.py | python +if ! [ -x "$(command -v pip)" ]; then + curl -k https://bootstrap.pypa.io/get-pip.py | python +fi pip install --upgrade $DIR #Code to compile and install yara