From fab0be63a4ab32b682142a7a1054c8adabf45c58 Mon Sep 17 00:00:00 2001 From: Tanishq Rupaal Date: Wed, 15 May 2024 19:07:57 -0500 Subject: [PATCH] drop work docker in favor of sec; image base to jammy --- .github/paused-work-build.yml | 25 ------ .github/workflows/work-build-arm.yml | 31 ------- security_docker_arm/Dockerfile | 2 +- security_docker_arm/builder.Dockerfile | 2 +- security_docker_arm/local-builder-script.sh | 4 +- security_docker_main/Dockerfile | 2 +- security_docker_main/builder.Dockerfile | 2 +- worker_docker_arm/Dockerfile | 99 --------------------- worker_docker_arm/builder.Dockerfile | 42 --------- worker_docker_arm/ec2-builder-script.sh | 24 ----- worker_docker_arm/local-builder-script.sh | 4 - worker_docker_main/Dockerfile | 99 --------------------- worker_docker_main/builder.Dockerfile | 42 --------- worker_docker_main/ec2-builder-script.sh | 24 ----- worker_docker_main/local-builder-script.sh | 4 - 15 files changed, 6 insertions(+), 400 deletions(-) delete mode 100644 .github/paused-work-build.yml delete mode 100644 .github/workflows/work-build-arm.yml delete mode 100644 worker_docker_arm/Dockerfile delete mode 100644 worker_docker_arm/builder.Dockerfile delete mode 100644 worker_docker_arm/ec2-builder-script.sh delete mode 100644 worker_docker_arm/local-builder-script.sh delete mode 100644 worker_docker_main/Dockerfile delete mode 100644 worker_docker_main/builder.Dockerfile delete mode 100644 worker_docker_main/ec2-builder-script.sh delete mode 100644 worker_docker_main/local-builder-script.sh diff --git a/.github/paused-work-build.yml b/.github/paused-work-build.yml deleted file mode 100644 index 0d9ff0c..0000000 --- a/.github/paused-work-build.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Work Main - -on: - push: - branches: - - 'main' - schedule: - - cron: '0 0 15 * *' - workflow_dispatch: - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker Login - uses: docker/login-action@v3 - with: - username: tanq16 - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - - run: chmod +x ./worker_docker_main/local-builder-script.sh - - run: cd ./worker_docker_main && bash local-builder-script.sh diff --git a/.github/workflows/work-build-arm.yml b/.github/workflows/work-build-arm.yml deleted file mode 100644 index fd39715..0000000 --- a/.github/workflows/work-build-arm.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Work Main (ARM) - -on: - push: - branches: - - 'main' - schedule: - - cron: '0 0 22 * *' - workflow_dispatch: - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: tanq16 - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - - run: chmod +x ./worker_docker_arm/local-builder-script.sh - - run: cd ./worker_docker_arm && bash local-builder-script.sh diff --git a/security_docker_arm/Dockerfile b/security_docker_arm/Dockerfile index 82d167f..1e2bd68 100644 --- a/security_docker_arm/Dockerfile +++ b/security_docker_arm/Dockerfile @@ -1,5 +1,5 @@ FROM intermediate_builder as intermediate_builder -FROM ubuntu +FROM ubuntu:jammy # ============================================================================================================ # ==================================================================== Environment and APT Installations ===== diff --git a/security_docker_arm/builder.Dockerfile b/security_docker_arm/builder.Dockerfile index 15d9899..37f47bc 100644 --- a/security_docker_arm/builder.Dockerfile +++ b/security_docker_arm/builder.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu AS executable_builder +FROM ubuntu:jammy AS executable_builder RUN mkdir /executables && apt update -y && \ apt install -y wget ninja-build gettext cmake unzip curl git file && \ wget https://github.com/neovim/neovim/archive/refs/tags/stable.tar.gz && \ diff --git a/security_docker_arm/local-builder-script.sh b/security_docker_arm/local-builder-script.sh index 6831008..9b219a8 100644 --- a/security_docker_arm/local-builder-script.sh +++ b/security_docker_arm/local-builder-script.sh @@ -1,4 +1,4 @@ -DOCKER_BUILDKIT=1 docker buildx build --platform linux/arm64 -f builder.Dockerfile -t intermediate_builder . +DOCKER_BUILDKIT=1 docker build -f builder.Dockerfile -t intermediate_builder . docker builder prune -f -DOCKER_BUILDKIT=1 docker buildx build --platform linux/arm64 -t tanq16/sec_docker:main_apple . +DOCKER_BUILDKIT=1 docker build -t tanq16/sec_docker:main_apple . docker push tanq16/sec_docker:main_apple diff --git a/security_docker_main/Dockerfile b/security_docker_main/Dockerfile index 63ad3a2..622dbfe 100644 --- a/security_docker_main/Dockerfile +++ b/security_docker_main/Dockerfile @@ -1,5 +1,5 @@ FROM intermediate_builder as intermediate_builder -FROM ubuntu +FROM ubuntu:jammy # ============================================================================================================ # ==================================================================== Environment and APT Installations ===== diff --git a/security_docker_main/builder.Dockerfile b/security_docker_main/builder.Dockerfile index 567aa4f..d145d30 100644 --- a/security_docker_main/builder.Dockerfile +++ b/security_docker_main/builder.Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu AS executable_builder +FROM ubuntu:jammy AS executable_builder RUN mkdir /executables && apt update -y && \ apt install -y wget ninja-build gettext cmake unzip curl git file && \ wget https://github.com/neovim/neovim/archive/refs/tags/stable.tar.gz && \ diff --git a/worker_docker_arm/Dockerfile b/worker_docker_arm/Dockerfile deleted file mode 100644 index a435562..0000000 --- a/worker_docker_arm/Dockerfile +++ /dev/null @@ -1,99 +0,0 @@ -FROM intermediate_builder:latest as intermediate_builder -FROM ubuntu - -# ============================================================================================================ -# ==================================================================== Environment and APT Installations ===== -# ============================================================================================================ - -RUN DEBIAN_FRONTEND="noninteractive" apt update && \ - DEBIAN_FRONTEND="noninteractive" apt upgrade -y && \ - apt install -y locales && \ - sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ - locale-gen -RUN DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \ - apt-transport-https software-properties-common apt-utils openssl gpg-agent \ - openssh-server openvpn wget git tmux tree gnupg gnupg2 curl less file zsh -RUN DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \ - bat fd-find htop jc jq make ugrep ripgrep groff ncat gcc zip unzip tzdata \ - locales language-pack-en bsdmainutils dnsutils ntp xfonts-utils whois -RUN DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \ - p7zip-full python3 python3-pip python3-setuptools iproute2 python3-venv python3-dev \ - inetutils-ping inetutils-telnet inetutils-tools inetutils-traceroute inetutils-ftp && \ - mkdir /opt/executables && python3 -m venv /opt/pyenv && \ - . /opt/pyenv/bin/activate && pip install --upgrade setuptools wheel pip - -COPY --from=intermediate_builder /executables /opt/executables -COPY --from=intermediate_builder /neovim-linux64.deb /neovim-linux64.deb -RUN DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends /neovim-linux64.deb && rm /neovim-linux64.deb -RUN chown -R root:root /opt/executables && chmod 755 /opt/executables/* - -# ============================================================================================================ -# =============================================================================== CLI Productivity Suite ===== -# ============================================================================================================ - -RUN curl -L http://install.ohmyz.sh | sh && \ - git clone https://github.com/spaceship-prompt/spaceship-prompt.git "/root/.oh-my-zsh/custom/themes/spaceship-prompt" --depth=1 && \ - ln -s "/root/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme" "/root/.oh-my-zsh/custom/themes/spaceship.zsh-theme" && \ - sed -i "s/robbyrussell/spaceship/" /root/.zshrc && \ - git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git /root/.oh-my-zsh/custom/plugins/zsh-autosuggestions && \ - git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git /root/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && \ - sed -i "s/plugins=/plugins=(git zsh-autosuggestions zsh-syntax-highlighting) #/" /root/.zshrc && \ - git clone --depth=1 https://github.com/tmux-plugins/tpm /root/.tmux/plugins/tpm && \ - wget https://raw.githubusercontent.com/Tanq16/cli-productivity-suite/master/tmuxconf && \ - mv tmuxconf /root/.tmux.conf && \ - wget https://raw.githubusercontent.com/Tanq16/cli-productivity-suite/master/linux.rcfile && \ - cat linux.rcfile >> /root/.zshrc && \ - rm linux.rcfile && \ - cp /root/.zshrc temptemp && \ - cat temptemp | grep -vE "^#" | grep -vE "^$" > /root/.zshrc && \ - rm temptemp && \ - chsh -s /usr/bin/zsh && \ - git clone --depth 1 https://github.com/junegunn/fzf.git /root/.fzf && \ - /root/.fzf/install --all 1>/dev/null && \ - a=$(curl -s https://api.github.com/repos/lsd-rs/lsd/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "aarch64" | grep -i "gnu" | cut -d '"' -f4) && \ - wget "$a" -O test.tar.gz && tar -xzf test.tar.gz && \ - mv lsd-*/lsd /usr/bin/lsd && \ - rm -rf lsd-* test.tar.gz && \ - git clone https://github.com/NvChad/starter /root/.config/nvim && \ - nvim --headless -c 'quitall' && \ - sed -i "s/autoload -Uz bracketed-paste-magic/#autoload -Uz bracketed-paste-magic/" /root/.oh-my-zsh/lib/misc.zsh && \ - sed -i "s/zle -N bracketed-paste bracketed-paste-magic/#zle -N bracketed-paste bracketed-paste-magic/" /root/.oh-my-zsh/lib/misc.zsh && \ - sed -i "s/autoload -Uz url-quote-magic/#autoload -Uz url-quote-magic/" /root/.oh-my-zsh/lib/misc.zsh && \ - sed -i "s/zle -N self-insert url-quote-magic/#zle -N self-insert url-quote-magic/" /root/.oh-my-zsh/lib/misc.zsh && \ - TMUX_PLUGIN_MANAGER_PATH=/root/.tmux/plugins /root/.tmux/plugins/tpm/bin/install_plugins - -# ============================================================================================================ -# ========================================================================== Tool Installations Part One ===== -# ============================================================================================================ - -RUN cd / && \ - a=$(curl -s https://go.dev/dl/ | grep -oE "(/dl/go[\.0-9]{2,7}\.linux-arm64\.tar\.gz)" | head -n 1) && \ - echo $a && wget "https://golang.org$a" && \ - b=$(echo $a | cut -d "/" -f3) && \ - echo $b && tar -C /usr/local -xzf "$b" && \ - rm "$b" && \ - curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && \ - unzip awscliv2.zip && \ - aws/install && \ - rm awscliv2.zip && \ - rm -rf aws && \ - mkdir /root/.aws && \ - touch /root/.aws/credentials && \ - touch /root/.aws/config && \ - echo '[default]\naws_access_key_id = \naws_secret_access_key = ' >> /root/.aws/credentials && \ - echo '[default]\nregion = us-east-1' >> /root/.aws/config - -# ============================================================================================================ -# ========================================================================== Tool Installations Part Two ===== -# ============================================================================================================ - -RUN . /opt/pyenv/bin/activate && \ - pip install boto3 requests - -# ============================================================================================================ -# ============================================================================================================ -# ============================================================================================================ - -RUN DEBIAN_FRONTEND="noninteractive" apt autoclean -y && \ - DEBIAN_FRONTEND="noninteractive" apt autoremove -y && \ - echo "PermitRootLogin yes" >> /etc/ssh/sshd_config diff --git a/worker_docker_arm/builder.Dockerfile b/worker_docker_arm/builder.Dockerfile deleted file mode 100644 index 11a9127..0000000 --- a/worker_docker_arm/builder.Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -FROM ubuntu AS executable_builder -RUN mkdir /executables && apt update -y && \ - apt install -y wget ninja-build gettext cmake unzip curl git file && \ - wget https://github.com/neovim/neovim/archive/refs/tags/stable.tar.gz && \ - tar -xvf stable.tar.gz && cd neovim-stable && \ - make CMAKE_BUILD_TYPE=RelWithDebInfo && \ - cd build && cpack -G DEB && \ - mv nvim-linux64.deb / -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "arm64" | grep -v "tar.gz" | cut -d '"' -f4) && \ - wget "$a" && mv yq_linux_arm64 /executables/yq && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/projectdiscovery/httpx/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "arm64" | cut -d '"' -f4) && \ - wget "$a" -O test.zip && unzip test.zip && \ - mv httpx /executables && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/projectdiscovery/dnsx/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "arm64" | cut -d '"' -f4) && \ - wget "$a" -O test.zip && unzip test.zip && \ - mv dnsx /executables && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/projectdiscovery/aix/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "arm64" | cut -d '"' -f4) && \ - wget "$a" -O test.zip && unzip test.zip && \ - mv aix /executables && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/projectdiscovery/simplehttpserver/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "arm64" | cut -d '"' -f4) && \ - wget "$a" -O test.zip && unzip test.zip && \ - mv simplehttpserver /executables && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/tomnomnom/gron/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "arm64" | cut -d '"' -f4) && \ - wget "$a" -O test.tar.gz && tar -xzf test.tar.gz && \ - mv gron /executables && cd .. && rm -rf testingground - -FROM golang AS go_builder -RUN mkdir /executables -RUN git clone --depth=1 https://github.com/hashicorp/terraform.git && \ - cd terraform && go get && go build && mv terraform /executables - -FROM alpine -RUN mkdir /executables/ -COPY --from=go_builder /executables/* /executables/ -COPY --from=executable_builder /executables/* /executables/ -COPY --from=executable_builder /nvim-linux64.deb /neovim-linux64.deb diff --git a/worker_docker_arm/ec2-builder-script.sh b/worker_docker_arm/ec2-builder-script.sh deleted file mode 100644 index 2cd9901..0000000 --- a/worker_docker_arm/ec2-builder-script.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# apt update -y 2>/dev/null 1>/dev/null && apt install docker.io -y 2>/dev/null 1>/dev/null -apt install ca-certificates curl gnupg -y 2>/dev/null && install -m 0755 -d /etc/apt/keyrings -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg -chmod a+r /etc/apt/keyrings/docker.gpg && echo \ - "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ - "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ - tee /etc/apt/sources.list.d/docker.list > /dev/null -apt update -y && apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y - -# tool build -DOCKER_BUILDKIT=1 docker build -f builder.Dockerfile -t intermediate_builder . -docker builder prune -f - -docker login --username $1 --password $2 - -# docker run -v $PWD:/shared --rm -it gobuilder sh -c 'mv executables/ /shared/' -# docker run -v $PWD:/shared --rm -it otherbuilder sh -c 'mv executables/noseyparker /shared/executables/ && mv neovim-linux64.deb /shared/' - -DOCKER_BUILDKIT=1 docker build -f Dockerfile -t tanq16/sec_docker:main . -docker push tanq16/sec_docker:main - -# rm -rf ./executables && rm neovim-linux64.deb diff --git a/worker_docker_arm/local-builder-script.sh b/worker_docker_arm/local-builder-script.sh deleted file mode 100644 index 50cab5d..0000000 --- a/worker_docker_arm/local-builder-script.sh +++ /dev/null @@ -1,4 +0,0 @@ -DOCKER_BUILDKIT=1 docker buildx build --platform linux/arm64 -f builder.Dockerfile -t intermediate_builder:latest . -docker builder prune -f -DOCKER_BUILDKIT=1 docker buildx build --platform linux/arm64 -t tanq16/work_docker:main_apple . -docker push tanq16/work_docker:main_apple diff --git a/worker_docker_main/Dockerfile b/worker_docker_main/Dockerfile deleted file mode 100644 index 3c0351f..0000000 --- a/worker_docker_main/Dockerfile +++ /dev/null @@ -1,99 +0,0 @@ -FROM intermediate_builder as intermediate_builder -FROM ubuntu - -# ============================================================================================================ -# ==================================================================== Environment and APT Installations ===== -# ============================================================================================================ - -RUN DEBIAN_FRONTEND="noninteractive" apt update && \ - DEBIAN_FRONTEND="noninteractive" apt upgrade -y && \ - apt install -y locales && \ - sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ - locale-gen -RUN DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \ - apt-transport-https software-properties-common apt-utils openssl gpg-agent \ - openssh-server openvpn wget git tmux tree gnupg gnupg2 curl less file zsh -RUN DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \ - bat fd-find htop jc jq make ugrep ripgrep groff ncat gcc zip unzip tzdata \ - locales language-pack-en bsdmainutils dnsutils ntp xfonts-utils whois -RUN DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \ - p7zip-full python3 python3-pip python3-setuptools iproute2 python3-venv python3-dev \ - inetutils-ping inetutils-telnet inetutils-tools inetutils-traceroute inetutils-ftp && \ - mkdir /opt/executables && python3 -m venv /opt/pyenv && \ - . /opt/pyenv/bin/activate && pip install --upgrade setuptools wheel pip - -COPY --from=intermediate_builder /executables /opt/executables -COPY --from=intermediate_builder /neovim-linux64.deb /neovim-linux64.deb -RUN DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends /neovim-linux64.deb && rm /neovim-linux64.deb -RUN chown -R root:root /opt/executables && chmod 755 /opt/executables/* - -# ============================================================================================================ -# =============================================================================== CLI Productivity Suite ===== -# ============================================================================================================ - -RUN curl -L http://install.ohmyz.sh | sh && \ - git clone https://github.com/spaceship-prompt/spaceship-prompt.git "/root/.oh-my-zsh/custom/themes/spaceship-prompt" --depth=1 && \ - ln -s "/root/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme" "/root/.oh-my-zsh/custom/themes/spaceship.zsh-theme" && \ - sed -i "s/robbyrussell/spaceship/" /root/.zshrc && \ - git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git /root/.oh-my-zsh/custom/plugins/zsh-autosuggestions && \ - git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git /root/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && \ - sed -i "s/plugins=/plugins=(git zsh-autosuggestions zsh-syntax-highlighting) #/" /root/.zshrc && \ - git clone --depth=1 https://github.com/tmux-plugins/tpm /root/.tmux/plugins/tpm && \ - wget https://raw.githubusercontent.com/Tanq16/cli-productivity-suite/master/tmuxconf && \ - mv tmuxconf /root/.tmux.conf && \ - wget https://raw.githubusercontent.com/Tanq16/cli-productivity-suite/master/linux.rcfile && \ - cat linux.rcfile >> /root/.zshrc && \ - rm linux.rcfile && \ - cp /root/.zshrc temptemp && \ - cat temptemp | grep -vE "^#" | grep -vE "^$" > /root/.zshrc && \ - rm temptemp && \ - chsh -s /usr/bin/zsh && \ - git clone --depth 1 https://github.com/junegunn/fzf.git /root/.fzf && \ - /root/.fzf/install --all 1>/dev/null && \ - a=$(curl -s https://api.github.com/repos/lsd-rs/lsd/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "x86_64" | grep -i "gnu" | cut -d '"' -f4) && \ - wget "$a" -O test.tar.gz && tar -xzf test.tar.gz && \ - mv lsd-*/lsd /usr/bin/lsd && \ - rm -rf lsd-* test.tar.gz && \ - git clone https://github.com/NvChad/starter /root/.config/nvim && \ - nvim --headless -c 'quitall' && \ - sed -i "s/autoload -Uz bracketed-paste-magic/#autoload -Uz bracketed-paste-magic/" /root/.oh-my-zsh/lib/misc.zsh && \ - sed -i "s/zle -N bracketed-paste bracketed-paste-magic/#zle -N bracketed-paste bracketed-paste-magic/" /root/.oh-my-zsh/lib/misc.zsh && \ - sed -i "s/autoload -Uz url-quote-magic/#autoload -Uz url-quote-magic/" /root/.oh-my-zsh/lib/misc.zsh && \ - sed -i "s/zle -N self-insert url-quote-magic/#zle -N self-insert url-quote-magic/" /root/.oh-my-zsh/lib/misc.zsh && \ - TMUX_PLUGIN_MANAGER_PATH=/root/.tmux/plugins /root/.tmux/plugins/tpm/bin/install_plugins - -# ============================================================================================================ -# ========================================================================== Tool Installations Part One ===== -# ============================================================================================================ - -RUN cd / && \ - a=$(curl -s https://go.dev/dl/ | grep -oE "(/dl/go[\.0-9]{2,7}\.linux-amd64\.tar\.gz)" | head -n 1) && \ - echo $a && wget "https://golang.org$a" && \ - b=$(echo $a | cut -d "/" -f3) && \ - echo $b && tar -C /usr/local -xzf "$b" && \ - rm "$b" && \ - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ - unzip awscliv2.zip && \ - aws/install && \ - rm awscliv2.zip && \ - rm -rf aws && \ - mkdir /root/.aws && \ - touch /root/.aws/credentials && \ - touch /root/.aws/config && \ - echo '[default]\naws_access_key_id = \naws_secret_access_key = ' >> /root/.aws/credentials && \ - echo '[default]\nregion = us-east-1' >> /root/.aws/config - -# ============================================================================================================ -# ========================================================================== Tool Installations Part Two ===== -# ============================================================================================================ - -RUN . /opt/pyenv/bin/activate && \ - pip install boto3 requests - -# ============================================================================================================ -# ============================================================================================================ -# ============================================================================================================ - -RUN DEBIAN_FRONTEND="noninteractive" apt autoclean -y && \ - DEBIAN_FRONTEND="noninteractive" apt autoremove -y && \ - echo "PermitRootLogin yes" >> /etc/ssh/sshd_config diff --git a/worker_docker_main/builder.Dockerfile b/worker_docker_main/builder.Dockerfile deleted file mode 100644 index 64ebd74..0000000 --- a/worker_docker_main/builder.Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -FROM ubuntu AS executable_builder -RUN mkdir /executables && apt update -y && \ - apt install -y wget ninja-build gettext cmake unzip curl git file && \ - wget https://github.com/neovim/neovim/archive/refs/tags/stable.tar.gz && \ - tar -xvf stable.tar.gz && cd neovim-stable && \ - make CMAKE_BUILD_TYPE=RelWithDebInfo && \ - cd build && cpack -G DEB && \ - mv nvim-linux64.deb / -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "amd64" | grep -v "tar.gz" | cut -d '"' -f4) && \ - wget "$a" && mv yq_linux_amd64 /executables/yq && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/projectdiscovery/httpx/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "amd64" | cut -d '"' -f4) && \ - wget "$a" -O test.zip && unzip test.zip && \ - mv httpx /executables && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/projectdiscovery/dnsx/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "amd64" | cut -d '"' -f4) && \ - wget "$a" -O test.zip && unzip test.zip && \ - mv dnsx /executables && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/projectdiscovery/aix/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "amd64" | cut -d '"' -f4) && \ - wget "$a" -O test.zip && unzip test.zip && \ - mv aix /executables && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/projectdiscovery/simplehttpserver/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "amd64" | cut -d '"' -f4) && \ - wget "$a" -O test.zip && unzip test.zip && \ - mv simplehttpserver /executables && cd .. && rm -rf testingground -RUN mkdir /testingground && cd /testingground && \ - a=$(curl -s https://api.github.com/repos/tomnomnom/gron/releases/latest | grep -E "browser_download_url.*" | grep -i "linux" | grep -i "amd64" | cut -d '"' -f4) && \ - wget "$a" -O test.tar.gz && tar -xzf test.tar.gz && \ - mv gron /executables && cd .. && rm -rf testingground - -FROM golang AS go_builder -RUN mkdir /executables -RUN git clone --depth=1 https://github.com/hashicorp/terraform.git && \ - cd terraform && go get && go build && mv terraform /executables - -FROM alpine -RUN mkdir /executables/ -COPY --from=go_builder /executables/* /executables/ -COPY --from=executable_builder /executables/* /executables/ -COPY --from=executable_builder /nvim-linux64.deb /neovim-linux64.deb diff --git a/worker_docker_main/ec2-builder-script.sh b/worker_docker_main/ec2-builder-script.sh deleted file mode 100644 index 2cd9901..0000000 --- a/worker_docker_main/ec2-builder-script.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# apt update -y 2>/dev/null 1>/dev/null && apt install docker.io -y 2>/dev/null 1>/dev/null -apt install ca-certificates curl gnupg -y 2>/dev/null && install -m 0755 -d /etc/apt/keyrings -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg -chmod a+r /etc/apt/keyrings/docker.gpg && echo \ - "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ - "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ - tee /etc/apt/sources.list.d/docker.list > /dev/null -apt update -y && apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y - -# tool build -DOCKER_BUILDKIT=1 docker build -f builder.Dockerfile -t intermediate_builder . -docker builder prune -f - -docker login --username $1 --password $2 - -# docker run -v $PWD:/shared --rm -it gobuilder sh -c 'mv executables/ /shared/' -# docker run -v $PWD:/shared --rm -it otherbuilder sh -c 'mv executables/noseyparker /shared/executables/ && mv neovim-linux64.deb /shared/' - -DOCKER_BUILDKIT=1 docker build -f Dockerfile -t tanq16/sec_docker:main . -docker push tanq16/sec_docker:main - -# rm -rf ./executables && rm neovim-linux64.deb diff --git a/worker_docker_main/local-builder-script.sh b/worker_docker_main/local-builder-script.sh deleted file mode 100644 index 184fb52..0000000 --- a/worker_docker_main/local-builder-script.sh +++ /dev/null @@ -1,4 +0,0 @@ -DOCKER_BUILDKIT=1 docker build -f builder.Dockerfile -t intermediate_builder . -docker builder prune -f -DOCKER_BUILDKIT=1 docker build -t tanq16/work_docker:main . -docker push tanq16/work_docker:main