Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Updating install.sh to use docker compose instead of deprecated docker-compose #617

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ do_install() {
if [ -d "$RCTF_INSTALL_PATH" ]; then
error "rCTF appears to already be installed in ${RCTF_INSTALL_PATH}"

info "... If you're trying to start rCTF, run 'docker-compose up -d'."
info "... If you're trying to start rCTF, run 'docker compose up -d'."
info "... If you're trying to reinstall rCTF, 'rm -rf $RCTF_INSTALL_PATH' then re-run this script."

exit 1
Expand All @@ -60,11 +60,6 @@ do_install() {
curl -fsS https://get.docker.com | sh
fi

if [ ! -x "$(command -v docker-compose)" ]; then
curl -fsSLo /usr/local/bin/docker-compose "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)"
chmod +x /usr/local/bin/docker-compose
fi

info "Configuring rCTF..."

RCTF_GIT_REF="${RCTF_GIT_REF:-"master"}"
Expand Down Expand Up @@ -108,7 +103,7 @@ do_install() {
info "Downloading rCTF..."

curl -fsSO "https://raw.githubusercontent.com/redpwn/rctf/$RCTF_GIT_REF/docker-compose.yml"
docker-compose pull
docker compose pull

info "Finished installation to ${RCTF_INSTALL_PATH}."

Expand All @@ -117,12 +112,12 @@ do_install() {
read -r result </dev/tty

if [ "$result" = "y" ]; then
info "Running 'docker-compose up -d'..."
docker-compose up -d
info "Running 'docker compose up -d'..."
docker compose up -d
info "rCTF is now running at 127.0.0.1:8080."
exit 0
else
info "If you would like to start rCTF, run 'docker-compose up -d' in $RCTF_INSTALL_PATH."
info "If you would like to start rCTF, run 'docker compose up -d' in $RCTF_INSTALL_PATH."
exit 0
fi
}
Expand Down