Skip to content

Instantly share code, notes, and snippets.

@andyone
Last active October 11, 2022 10:31
Show Gist options
  • Select an option

  • Save andyone/948f5b520059e043654418edd923a8ba to your computer and use it in GitHub Desktop.

Select an option

Save andyone/948f5b520059e043654418edd923a8ba to your computer and use it in GitHub Desktop.

Revisions

  1. andyone revised this gist Oct 11, 2022. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -72,8 +72,6 @@ installPackage() {
    curl -# -L -o "$rpm_file" "$url"
    rpm -i "$rpm_file"
    rm -f "$rpm_file"

    mv /usr/local/bin/* /usr/bin/
    }

    ################################################################################
  2. andyone revised this gist Oct 11, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.40.0"
    GRYPE_VER="0.50.2"
    HADOLINT_VER="2.10.0"
    TRIVY_VER="0.29.2"
    TRIVY_VER="0.32.1"

    ################################################################################

  3. andyone revised this gist Jun 23, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.38.0"
    GRYPE_VER="0.40.0"
    HADOLINT_VER="2.10.0"
    TRIVY_VER="0.28.0"
    TRIVY_VER="0.29.2"

    ################################################################################

  4. andyone revised this gist May 24, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.36.1"
    GRYPE_VER="0.38.0"
    HADOLINT_VER="2.10.0"
    TRIVY_VER="0.27.1"
    TRIVY_VER="0.28.0"

    ################################################################################

  5. andyone revised this gist May 10, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.35.0"
    GRYPE_VER="0.36.1"
    HADOLINT_VER="2.10.0"
    TRIVY_VER="0.27.1"

  6. andyone revised this gist Apr 27, 2022. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.34.7"
    HADOLINT_VER="2.9.3"
    TRIVY_VER="0.24.4"
    GRYPE_VER="0.35.0"
    HADOLINT_VER="2.10.0"
    TRIVY_VER="0.27.1"

    ################################################################################

  7. andyone revised this gist Mar 30, 2022. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.32.0"
    HADOLINT_VER="2.8.0"
    TRIVY_VER="0.22.0"
    GRYPE_VER="0.34.7"
    HADOLINT_VER="2.9.3"
    TRIVY_VER="0.24.4"

    ################################################################################

  8. andyone revised this gist Jan 27, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    DIVE_VER="0.10.0"
    GRYPE_VER="0.32.0"
    HADOLINT_VER="2.8.0"
    TRIVY_VER="0.21.2"
    TRIVY_VER="0.22.0"

    ################################################################################

  9. andyone revised this gist Jan 26, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.30.0"
    GRYPE_VER="0.32.0"
    HADOLINT_VER="2.8.0"
    TRIVY_VER="0.21.2"

  10. andyone revised this gist Jan 9, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.27.0"
    GRYPE_VER="0.30.0"
    HADOLINT_VER="2.8.0"
    TRIVY_VER="0.21.2"

  11. andyone revised this gist Dec 13, 2021. 1 changed file with 16 additions and 1 deletion.
    17 changes: 16 additions & 1 deletion docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -18,11 +18,26 @@ main() {
    }

    installDocker() {
    if [[ -f "/etc/fedora-release" ]] ; then
    installDockerFedora
    else
    installDockerCentOS
    fi

    systemctl start docker
    }

    installDockerFedora() {
    dnf install -y dnf-plugins-core
    dnf config-manager --add-repo "https://download.docker.com/linux/fedora/docker-ce.repo"
    dnf install -y docker-ce docker-ce-cli containerd.io
    }

    installDockerCentOS() {
    yum install -y yum-utils
    yum-config-manager --add-repo "https://download.docker.com/linux/centos/docker-ce.repo"
    yum install -y docker-ce docker-ce-cli containerd.io
    configureKernel
    systemctl start docker
    }

    configureKernel() {
  12. andyone revised this gist Dec 9, 2021. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.20.0"
    HADOLINT_VER="2.7.0"
    TRIVY_VER="0.19.2"
    GRYPE_VER="0.27.0"
    HADOLINT_VER="2.8.0"
    TRIVY_VER="0.21.2"

    ################################################################################

  13. andyone revised this gist Sep 23, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -42,8 +42,8 @@ installGrype() {

    installHadolint() {
    curl -# -L -o "hadolint" "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VER}/hadolint-Linux-x86_64"
    chmod +x hadolint
    mv hadolint /usr/bin/hadolint
    rm -f hadolint
    }

    installTrivy() {
  14. andyone revised this gist Sep 23, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ installDocker() {
    configureKernel() {
    if ! grep -q 'net.ipv4.ip_forward' /etc/sysctl.conf ; then
    echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
    sysctl -p
    sysctl -p &> /dev/null
    fi
    }

  15. andyone revised this gist Sep 23, 2021. 1 changed file with 13 additions and 2 deletions.
    15 changes: 13 additions & 2 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -21,9 +21,17 @@ installDocker() {
    yum install -y yum-utils
    yum-config-manager --add-repo "https://download.docker.com/linux/centos/docker-ce.repo"
    yum install -y docker-ce docker-ce-cli containerd.io
    configureKernel
    systemctl start docker
    }

    configureKernel() {
    if ! grep -q 'net.ipv4.ip_forward' /etc/sysctl.conf ; then
    echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
    sysctl -p
    fi
    }

    installDive() {
    installPackage "https://github.com/wagoodman/dive/releases/download/v${DIVE_VER}/dive_${DIVE_VER}_linux_amd64.rpm"
    }
    @@ -33,8 +41,9 @@ installGrype() {
    }

    installHadolint() {
    wget "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VER}/hadolint-Linux-x86_64"
    mv hadolint-Linux-x86_64 /usr/bin/hadolint
    curl -# -L -o "hadolint" "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VER}/hadolint-Linux-x86_64"
    mv hadolint /usr/bin/hadolint
    rm -f hadolint
    }

    installTrivy() {
    @@ -48,6 +57,8 @@ installPackage() {
    curl -# -L -o "$rpm_file" "$url"
    rpm -i "$rpm_file"
    rm -f "$rpm_file"

    mv /usr/local/bin/* /usr/bin/
    }

    ################################################################################
  16. andyone created this gist Sep 23, 2021.
    55 changes: 55 additions & 0 deletions docker-dev-env.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    #!/bin/bash

    ################################################################################

    DIVE_VER="0.10.0"
    GRYPE_VER="0.20.0"
    HADOLINT_VER="2.7.0"
    TRIVY_VER="0.19.2"

    ################################################################################

    main() {
    installDocker
    installDive
    installGrype
    installHadolint
    installTrivy
    }

    installDocker() {
    yum install -y yum-utils
    yum-config-manager --add-repo "https://download.docker.com/linux/centos/docker-ce.repo"
    yum install -y docker-ce docker-ce-cli containerd.io
    systemctl start docker
    }

    installDive() {
    installPackage "https://github.com/wagoodman/dive/releases/download/v${DIVE_VER}/dive_${DIVE_VER}_linux_amd64.rpm"
    }

    installGrype() {
    installPackage "https://github.com/anchore/grype/releases/download/v${GRYPE_VER}/grype_${GRYPE_VER}_linux_amd64.rpm"
    }

    installHadolint() {
    wget "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VER}/hadolint-Linux-x86_64"
    mv hadolint-Linux-x86_64 /usr/bin/hadolint
    }

    installTrivy() {
    installPackage "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VER}/trivy_${TRIVY_VER}_Linux-64bit.rpm"
    }

    installPackage() {
    local url="$1"
    local rpm_file=$(basename "$url")

    curl -# -L -o "$rpm_file" "$url"
    rpm -i "$rpm_file"
    rm -f "$rpm_file"
    }

    ################################################################################

    main "$@"