diff --git a/Makefile b/Makefile index 7afffb4e4ac..4f584d87973 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ DC_CI = "bin/docker-compose.sh" -DC = $(shell which docker-compose) +DC = $(shell which docker) compose DOCKER = $(shell which docker) TEST_DOMAIN = www.mozilla.org POCKET_MODE = Pocket @@ -9,7 +9,7 @@ all: help help: @echo "Please use \`make ' where is one of" @echo " build - build docker images for dev" - @echo " run - docker-compose up the entire system for dev" + @echo " run - 'docker compose up' the entire system for dev" @echo " stop - stop all docker containers" @echo " kill - kill all docker containers (more forceful than stop)" @echo " pull - pull the latest production images from Docker Hub" diff --git a/bin/docker-compose.sh b/bin/docker-compose.sh index 9dfecd42fe8..3eeb8b80ad6 100755 --- a/bin/docker-compose.sh +++ b/bin/docker-compose.sh @@ -6,4 +6,4 @@ source docker/bin/set_git_env_vars.sh -docker-compose "$@" +docker compose "$@" diff --git a/bin/integration_tests/cleanup_after_functional_tests.sh b/bin/integration_tests/cleanup_after_functional_tests.sh index d74fd7bbfd7..945b2319e02 100755 --- a/bin/integration_tests/cleanup_after_functional_tests.sh +++ b/bin/integration_tests/cleanup_after_functional_tests.sh @@ -18,7 +18,7 @@ docker cp "bedrock-${CI_JOB_ID}:/app/tests/results" "results-${CI_JOB_ID}" docker rm "bedrock-${CI_JOB_ID}" if [ "${DRIVER}" = "Remote" ]; then - docker-compose \ + docker compose \ -f ./bin/integration_tests/docker_compose_for_integration_tests.yml \ -p "selenium-hub-${CI_JOB_ID}" \ down --remove-orphans diff --git a/bin/integration_tests/docker_compose_for_integration_tests.yml b/bin/integration_tests/docker_compose_for_integration_tests.yml index efbd0047609..fb9b2e4f1e1 100644 --- a/bin/integration_tests/docker_compose_for_integration_tests.yml +++ b/bin/integration_tests/docker_compose_for_integration_tests.yml @@ -1,4 +1,3 @@ -version: "3" services: selenium-hub: image: selenium/hub:3 diff --git a/bin/integration_tests/functional_tests.sh b/bin/integration_tests/functional_tests.sh index 7a7c0c9e170..90a9f704a7a 100755 --- a/bin/integration_tests/functional_tests.sh +++ b/bin/integration_tests/functional_tests.sh @@ -18,23 +18,23 @@ then fi if [ "${DRIVER}" = "Remote" ]; then - docker-compose \ + docker compose \ -f ./bin/integration_tests/docker_compose_for_integration_tests.yml \ -p "selenium-hub-${CI_JOB_ID}" \ up -d selenium-hub - docker-compose \ + docker compose \ -f ./bin/integration_tests/docker_compose_for_integration_tests.yml \ -p "selenium-hub-${CI_JOB_ID}" \ up -d --scale ${BROWSER_NAME}=${NUM_BROWSER_NODES} ${BROWSER_NAME} SELENIUM_HOST="grid" SELENIUM_PORT=4444 - DOCKER_LINKS=(--link selenium-hub-${CI_JOB_ID}_selenium-hub_1:grid --net selenium-hub-${CI_JOB_ID}_default) + DOCKER_LINKS=(--link selenium-hub-${CI_JOB_ID}-selenium-hub-1:grid --net selenium-hub-${CI_JOB_ID}_default) echo -n "Waiting for Selenium Grid to get ready..." - IP=$(docker inspect selenium-hub-${CI_JOB_ID}_selenium-hub_1 | jq -r .[0].NetworkSettings.Networks[].IPAddress) + IP=$(docker inspect selenium-hub-${CI_JOB_ID}-selenium-hub-1 | jq -r .[0].NetworkSettings.Networks[].IPAddress) set +e SELENIUM_READY=$((curl -fs http://${IP}:4444/wd/hub/status | jq -es 'if . == [] then null else .[] | .value.ready end' > /dev/null) || echo "false") while ! ${SELENIUM_READY}; do diff --git a/bin/upload-staticfiles.sh b/bin/upload-staticfiles.sh index 773a06a1dab..263625d3c19 100755 --- a/bin/upload-staticfiles.sh +++ b/bin/upload-staticfiles.sh @@ -26,12 +26,12 @@ CONTAINER_NAME="bedrock-${GIT_COMMIT}" rm -rf "${TMP_DIR}" rm -rf "${TMP_DIR_HASHED}" -# .env file must exist for docker-compose +# .env file must exist for docker compose touch .env # have to rerun staticfiles without symlinks or we just copy broken symlinks docker rm -f "$CONTAINER_NAME" || true -docker-compose run --name "$CONTAINER_NAME" release docker/bin/build_staticfiles.sh --nolink +docker compose run --name "$CONTAINER_NAME" release docker/bin/build_staticfiles.sh --nolink docker cp "${CONTAINER_NAME}:/app/static" "${TMP_DIR}" docker rm -f "$CONTAINER_NAME" diff --git a/docker/bin/postbuild.sh b/docker/bin/postbuild.sh index 5b82db93d50..784b3c5400f 100755 --- a/docker/bin/postbuild.sh +++ b/docker/bin/postbuild.sh @@ -5,6 +5,6 @@ set -ex -# Docker-Compose does not remove the running database instace. We cannot use docker-compose +# Docker compose does not remove the running database instace. We cannot use docker compose # rm here because we re-tagged the image while uploading to DockerHub. docker rm -f `echo jenkins${JOB_NAME}${BUILD_NUMBER}| sed s/_//g`_db_1 diff --git a/docker/bin/run_tests.sh b/docker/bin/run_tests.sh index f6037fd627e..75f3c7ae6fd 100755 --- a/docker/bin/run_tests.sh +++ b/docker/bin/run_tests.sh @@ -10,4 +10,4 @@ set -exo pipefail source docker/bin/set_git_env_vars.sh -exec docker-compose run test-image +exec docker compose run test-image diff --git a/docs/install.rst b/docs/install.rst index eae2876dd4e..5c34648b5b6 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -63,7 +63,7 @@ If you don't have or want to use Make you can call the docker and compose comman .. code-block:: bash - $ docker-compose pull + $ docker compose pull .. code-block:: bash @@ -73,7 +73,7 @@ Then starting it all is simply .. code-block:: bash - $ docker-compose up app assets + $ docker compose up app assets All of this is handled by the ``Makefile`` script and called by Make if you follow the above directions. You **DO NOT** need to do both. @@ -101,7 +101,7 @@ If you make a change to ``media/static-bundles.json``, you'll need to restart Do Sometimes stopping Docker doesn't actually kill the images. To be safe, after stopping docker, run ``docker ps`` to ensure the containers were actually stopped. If they have not been stopped, you can force - them by running ``docker-compose kill`` to stop all containers, or ``docker kill `` to stop + them by running ``docker compose kill`` to stop all containers, or ``docker kill `` to stop a single container, e.g. ``docker kill bedrock_app_1``. Local Installation @@ -252,23 +252,23 @@ you've broken something with a change. Docker ------ -We manage our local docker environment with docker-compose and Make. All you need to do here is run:: +We manage our local docker environment with docker compose and Make. All you need to do here is run:: $ make test -If you don't have Make you can simply run ``docker-compose run test``. +If you don't have Make you can simply run ``docker compose run test``. If you'd like to run only a subset of the tests or only one of the test commands you can accomplish that with a command like the following:: - $ docker-compose run test pytest bedrock/firefox + $ docker compose run test pytest bedrock/firefox This example will run only the unit tests for the ``firefox`` app in bedrock. You can substitute ``pytest bedrock/firefox`` with most any shell command you'd like and it will run in the Docker container and show you the output. You can also just run ``bash`` to get an interactive shell in the container which you can then use to run any commands you'd like and inspect the file system:: - $ docker-compose run test bash + $ docker compose run test bash Local ----- @@ -295,9 +295,9 @@ Make it run Docker ------ -You can simply run the ``make run`` script mentioned above, or use docker-compose directly:: +You can simply run the ``make run`` script mentioned above, or use docker compose directly:: - $ docker-compose up app assets + $ docker compose up app assets Local -----