From 787d466d39d48c7ddde493ecb36c6751e14c9a24 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Thu, 11 Jul 2024 15:24:47 -0600 Subject: [PATCH 01/13] Update ruby folder --- content/language/_index.md | 58 + content/language/ruby/_index.md | 18 + content/language/ruby/configure-ci-cd.md | 129 ++ content/language/ruby/containerize.md | 227 ++ content/language/ruby/deploy.md | 142 ++ content/language/ruby/develop.md | 330 +++ data/toc.yaml | 2400 ++++++++++++++++++++++ 7 files changed, 3304 insertions(+) create mode 100644 content/language/_index.md create mode 100644 content/language/ruby/_index.md create mode 100644 content/language/ruby/configure-ci-cd.md create mode 100644 content/language/ruby/containerize.md create mode 100644 content/language/ruby/deploy.md create mode 100644 content/language/ruby/develop.md create mode 100644 data/toc.yaml diff --git a/content/language/_index.md b/content/language/_index.md new file mode 100644 index 00000000000..56d0b10a4be --- /dev/null +++ b/content/language/_index.md @@ -0,0 +1,58 @@ +--- +description: Language-specific guides overview +keywords: guides, docker, language, node, java, python, R, go, golang, .net, c++ +title: Language-specific guides overview +toc_min: 1 +toc_max: 2 +aliases: +- /guides/walkthroughs/containerize-your-app/ +--- + +The language-specific guides walk you through the process of: +* Containerizing language-specific applications +* Setting up a development environment +* Configuring a CI/CD pipeline +* Deploying an application locally using Kubernetes + +In addition to the language-specific modules, Docker documentation also provides guidelines to build images and efficiently manage your development environment. For more information, refer to the following topics: + +* [Building best practices](../build/building/best-practices.md) +* [Build images with BuildKit](../build/buildkit/index.md#getting-started) +* [Build with Docker](../build/guide/_index.md) + +## Language-specific guides + +Learn how to containerize your applications and start developing using Docker. Choose one of the following languages to get started. + +
+
+ Develop with Node +
+
+ Develop with Python +
+
+ Develop with R +
+
+ Develop with Java +
+
+ Develop with Go +
+
+ Develop with C# +
+
+ Develop with C++ +
+
+ Develop with Rust +
+
+ Develop with PHP +
+
+ Develop with Ruby +
+
diff --git a/content/language/ruby/_index.md b/content/language/ruby/_index.md new file mode 100644 index 00000000000..b43ea5905e6 --- /dev/null +++ b/content/language/ruby/_index.md @@ -0,0 +1,18 @@ +--- +description: Containerize Ruby on Rails apps using Docker +keywords: Docker, getting started, ruby, language +title: Ruby on Rails language-specific guide +toc_min: 1 +toc_max: 2 +--- + +The Ruby on Rails language-specific guide teaches you how to containerize a Ruby on Rails application using Docker. In this guide, you’ll learn how to: + +* Containerize and run a Ruby on Rails application +* Set up a local environment to develop a Ruby on Rails application using containers +* Configure a CI/CD pipeline for a containerized Ruby on Rails application using GitHub Actions +* Deploy your containerized Ruby on Rails application locally to Kubernetes to test and debug your deployment + +Start by containerizing an existing Ruby on Rails application. + +{{< button text="Containerize a Ruby on Rails app" url="containerize.md" >}} diff --git a/content/language/ruby/configure-ci-cd.md b/content/language/ruby/configure-ci-cd.md new file mode 100644 index 00000000000..db32c44f65d --- /dev/null +++ b/content/language/ruby/configure-ci-cd.md @@ -0,0 +1,129 @@ +--- +title: Configure CI/CD for your Ruby on Rails application +keywords: ci/cd, github actions, ruby, flask +description: Learn how to configure CI/CD using GitHub Actions for your Ruby on Rails application. +--- + +## Prerequisites + +Complete all the previous sections of this guide, starting with [Containerize a Ruby on Rails application](containerize.md). You must have a [GitHub](https://github.com/signup) account and a [Docker](https://hub.docker.com/signup) account to complete this section. + +## Overview + +In this section, you'll learn how to set up and use GitHub Actions to build and test your Docker image as well as push it to Docker Hub. You will complete the following steps: + +1. Create a new repository on GitHub. +2. Define the GitHub Actions workflow. +3. Run the workflow. + +## Step one: Create the repository + +Create a GitHub repository, configure the Docker Hub credentials, and push your source code. + +1. [Create a new repository](https://github.com/new) on GitHub. + +2. Open the repository **Settings**, and go to **Secrets and variables** > + **Actions**. + +3. Create a new **Repository variable** named `DOCKER_USERNAME` and your Docker ID as value. + +4. Create a new [Personal Access Token (PAT)](../../security/for-developers/access-tokens.md/#create-an-access-token) for Docker Hub. You can name this token `docker-tutorial`. Make sure access permissions include Read and Write. + +5. Add the PAT as a **Repository secret** in your GitHub repository, with the name + `DOCKERHUB_TOKEN`. + +6. In your local repository on your machine, run the following command to change + the origin to the repository you just created. Make sure you change + `your-username` to your GitHub username and `your-repository` to the name of + the repository you created. + + ```console + $ git remote set-url origin https://github.com/your-username/your-repository.git + ``` + +7. Run the following commands to stage, commit, and push your local repository to GitHub. + + ```console + $ git add -A + $ git commit -m "my commit" + $ git push -u origin main + ``` + +## Step two: Set up the workflow + +Set up your GitHub Actions workflow for building, testing, and pushing the image +to Docker Hub. + +1. Go to your repository on GitHub and then select the **Actions** tab. + +2. Select **set up a workflow yourself**. + + This takes you to a page for creating a new GitHub actions workflow file in + your repository, under `.github/workflows/main.yml` by default. + +3. In the editor window, copy and paste the following YAML configuration. + + ```yaml + name: ci + + on: + push: + branches: + - main + + jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest + ``` + + For more information about the YAML syntax for `docker/build-push-action`, + refer to the [GitHub Action README](https://github.com/docker/build-push-action/blob/master/README.md). + +## Step three: Run the workflow + +Save the workflow file and run the job. + +1. Select **Commit changes...** and push the changes to the `main` branch. + + After pushing the commit, the workflow starts automatically. + +2. Go to the **Actions** tab. It displays the workflow. + + Selecting the workflow shows you the breakdown of all the steps. + +3. When the workflow is complete, go to your + [repositories on Docker Hub](https://hub.docker.com/repositories). + + If you see the new repository in that list, it means the GitHub Actions + successfully pushed the image to Docker Hub. + +## Summary + +In this section, you learned how to set up a GitHub Actions workflow for your Ruby on Rails application. + +Related information: + - [Introduction to GitHub Actions](../../build/ci/github-actions/index.md) + - [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions) + +## Next steps + +Next, learn how you can locally test and debug your workloads on Kubernetes before deploying. + +{{< button text="Test your deployment" url="./deploy.md" >}} diff --git a/content/language/ruby/containerize.md b/content/language/ruby/containerize.md new file mode 100644 index 00000000000..3f17d73a788 --- /dev/null +++ b/content/language/ruby/containerize.md @@ -0,0 +1,227 @@ +--- +title: Containerize a Ruby on Rails application +keywords: ruby, flask, containerize, initialize +description: Learn how to containerize a Ruby on Rails application. +aliases: + - /language/ruby/build-images/ + - /language/ruby/run-containers/ +--- + +## Prerequisites + +* You have installed the latest version of [Docker Desktop](../../get-docker.md). +* You have a [git client](https://git-scm.com/downloads). The examples in this section use a command-line based git client, but you can use any client. + +## Overview + +This section walks you through containerizing and running a Ruby on Rails application. + +## Get the sample application + +The sample application uses the popular [Ruby on Rails](https://rubyonrails.org/) framework. + +Clone the sample application to use with this guide. Open a terminal, change directory to a directory that you want to work in, and run the following command to clone the repository: + +```console +$ git clone https://github.com/falconcr/docker-ruby-on-rails.git +``` + +## Initialize Docker assets + +Now that you have an application, you can create the necessary Docker assets to +containerize your application. You can use Docker Desktop's built-in Docker Init +feature to help streamline the process, or you can manually create the assets. + +Docker's docker init command provides predefined configurations tailored for specific programming languages. This feature simplifies the setup process by automatically generating Dockerfiles and other necessary configuration files based on the chosen language. For example, docker init has predefined configurations for languages like Python, Java, and Node.js, making it easier to get started with Docker for these environments. + +However, it's important to note that as of now, docker init does not offer a predefined configuration for the Ruby programming language. This means that if you are working with Ruby, you'll need to create Dockerfiles and other related configurations manually. + +Inside the `docker-ruby-on-rails` directory, you should create the following files: + +Create a file named `Dockerfile` with the following contents. + +```dockerfile {collapse=true,title=Dockerfile} +# syntax=docker/dockerfile:1 + +# Use the official Ruby image with version 3.2.0 +FROM ruby:3.2.0 + +# Install dependencies +RUN apt-get update -qq && apt-get install -y \ + nodejs \ + postgresql-client \ + libssl-dev \ + libreadline-dev \ + zlib1g-dev \ + build-essential \ + curl + +# Install rbenv +RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv && \ + echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && \ + echo 'eval "$(rbenv init -)"' >> ~/.bashrc && \ + git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build && \ + echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc + +# Install the specified Ruby version using rbenv +ENV PATH="/root/.rbenv/bin:/root/.rbenv/shims:$PATH" +RUN rbenv install 3.2.0 && rbenv global 3.2.0 + +# Set the working directory +WORKDIR /myapp + +# Copy the Gemfile and Gemfile.lock +COPY Gemfile /myapp/Gemfile +COPY Gemfile.lock /myapp/Gemfile.lock + +# Install Gems dependencies +RUN gem install bundler && bundle install + +# Copy the application code +COPY . /myapp + +# Precompile assets (optional, if using Rails with assets) +RUN bundle exec rake assets:precompile + +# Expose the port the app runs on +EXPOSE 3000 + +# Command to run the server +CMD ["rails", "server", "-b", "0.0.0.0"] +``` + +Create a file named `compose.yaml` with the following contents. + +```yaml {collapse=true,title=compose.yaml} +version: '3' +services: + web: + build: . + command: bundle exec rails s -b '0.0.0.0' + volumes: + - .:/myapp + ports: + - "3000:3000" +``` + +Create a file named `.dockerignore` with the following contents. + +```text {collapse=true,title=".dockerignore"} +# Include any files or directories that you don't want to be copied to your +# container here (e.g., local build artifacts, temporary files, etc.). +# +# For more help, visit the .dockerignore file reference guide at +# https://docs.docker.com/go/build-context-dockerignore/ + +# Ignore bundler config +/.bundle + +# Ignore all log files and tempfiles +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore the development and test databases +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore the production secrets file +/config/secrets.yml + +# Ignore all files in the test, spec, and features folders +/test/* +/spec/* +/features/* + +# Ignore system-specific files +*.swp +*.swo +*~ +*.DS_Store + +# Ignore coverage reports +/coverage/* + +# Ignore node modules (if using a JavaScript front-end with Ruby on Rails) +/node_modules + +# Ignore yarn lock file +/yarn.lock + +# Ignore the .git directory and other VCS files +.git +.gitignore + +**/docker-compose* +**/compose.y*ml +**/Dockerfile* +LICENSE +README.md +``` + +You should now have the following three files in your `docker-ruby-on-rails` +directory. + + +- .dockerignore +- compose.yaml +- Dockerfile + + +To learn more about the files, see the following: + - [Dockerfile](../../reference/dockerfile.md) + - [.dockerignore](../../reference/dockerfile.md#dockerignore-file) + - [compose.yaml](../../compose/compose-file/_index.md) + +## Run the application + +Inside the `docker-ruby-on-rails` directory, run the following command in a +terminal. + +```console +$ docker compose up --build +``` + +Open a browser and view the application at [http://localhost:8000](http://localhost:8000). You should see a simple Ruby on Rails application. + +In the terminal, press `ctrl`+`c` to stop the application. + +### Run the application in the background + +You can run the application detached from the terminal by adding the `-d` +option. Inside the `docker-ruby-on-rails` directory, run the following command +in a terminal. + +```console +$ docker compose up --build -d +``` + +Open a browser and view the application at [http://localhost:3000](http://localhost:3000). + +You should see a simple Ruby on Rails application. + +In the terminal, run the following command to stop the application. + +```console +$ docker compose down +``` + +For more information about Compose commands, see the [Compose CLI +reference](../../compose/reference/_index.md). + +## Summary + +In this section, you learned how you can containerize and run your Ruby +application using Docker. + +Related information: + - [Build with Docker guide](../../build/guide/index.md) + - [Docker Compose overview](../../compose/_index.md) + +## Next steps + +In the next section, you'll learn how you can develop your application using +containers. + +{{< button text="Develop your application" url="develop.md" >}} diff --git a/content/language/ruby/deploy.md b/content/language/ruby/deploy.md new file mode 100644 index 00000000000..370dd0a4528 --- /dev/null +++ b/content/language/ruby/deploy.md @@ -0,0 +1,142 @@ +--- +title: Test your Ruby on Rails deployment +keywords: deploy, kubernetes, ruby +description: Learn how to develop locally using Kubernetes +--- + +## Prerequisites + +- Complete all the previous sections of this guide, starting with [Containerize a Python application](containerize.md). +- [Turn on Kubernetes](/desktop/kubernetes/#install-and-turn-on-kubernetes) in Docker Desktop. + +## Overview + +In this section, you'll learn how to use Docker Desktop to deploy your application to a fully-featured Kubernetes environment on your development machine. This allows you to test and debug your workloads on Kubernetes locally before deploying. + +## Create a Kubernetes YAML file + +In your `python-docker-dev` directory, create a file named +`docker-python-kubernetes.yaml`. Open the file in an IDE or text editor and add +the following contents. Replace `DOCKER_USERNAME/REPO_NAME` with your Docker +username and the name of the repository that you created in [Configure CI/CD for +your Python application](configure-ci-cd.md). + +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: docker-python-demo + namespace: default +spec: + replicas: 1 + selector: + matchLabels: + service: flask + template: + metadata: + labels: + service: flask + spec: + containers: + - name: flask-service + image: DOCKER_USERNAME/REPO_NAME + imagePullPolicy: Always + env: + - name: POSTGRES_PASSWORD + value: mysecretpassword +--- +apiVersion: v1 +kind: Service +metadata: + name: service-entrypoint + namespace: default +spec: + type: NodePort + selector: + service: flask + ports: + - port: 8001 + targetPort: 8001 + nodePort: 30001 +``` + +In this Kubernetes YAML file, there are two objects, separated by the `---`: + + - A Deployment, describing a scalable group of identical pods. In this case, + you'll get just one replica, or copy of your pod. That pod, which is + described under `template`, has just one container in it. The + container is created from the image built by GitHub Actions in [Configure CI/CD for + your Python application](configure-ci-cd.md). + - A NodePort service, which will route traffic from port 30001 on your host to + port 8001 inside the pods it routes to, allowing you to reach your app + from the network. + +To learn more about Kubernetes objects, see the [Kubernetes documentation](https://kubernetes.io/docs/home/). + +## Deploy and check your application + +1. In a terminal, navigate to `python-docker-dev` and deploy your application to + Kubernetes. + + ```console + $ kubectl apply -f docker-python-kubernetes.yaml + ``` + + You should see output that looks like the following, indicating your Kubernetes objects were created successfully. + + ```shell + deployment.apps/docker-python-demo created + service/service-entrypoint created + ``` + +2. Make sure everything worked by listing your deployments. + + ```console + $ kubectl get deployments + ``` + + Your deployment should be listed as follows: + + ```shell + NAME READY UP-TO-DATE AVAILABLE AGE + docker-python-demo 1/1 1 1 15s + ``` + + This indicates all one of the pods you asked for in your YAML are up and running. Do the same check for your services. + + ```console + $ kubectl get services + ``` + + You should get output like the following. + + ```shell + NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + kubernetes ClusterIP 10.96.0.1 443/TCP 23h + service-entrypoint NodePort 10.99.128.230 8001:30001/TCP 75s + ``` + + In addition to the default `kubernetes` service, you can see your `service-entrypoint` service, accepting traffic on port 30001/TCP. + +3. In a terminal, curl the service. Note that a database was not deployed in + this example. + + ```console + $ curl http://localhost:30001/ + Hello, Docker!!! + ``` + +4. Run the following command to tear down your application. + + ```console + $ kubectl delete -f docker-python-kubernetes.yaml + ``` + +## Summary + +In this section, you learned how to use Docker Desktop to deploy your application to a fully-featured Kubernetes environment on your development machine. + +Related information: + - [Kubernetes documentation](https://kubernetes.io/docs/home/) + - [Deploy on Kubernetes with Docker Desktop](../../desktop/kubernetes.md) + - [Swarm mode overview](../../engine/swarm/_index.md) \ No newline at end of file diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md new file mode 100644 index 00000000000..2711f7e214c --- /dev/null +++ b/content/language/ruby/develop.md @@ -0,0 +1,330 @@ +--- +title: Use containers for Ruby on Rails development +keywords: ruby, local, development +description: Learn how to develop your Ruby on Rails application locally. +--- + +## Prerequisites + +Complete [Containerize a Ruby on Rails application](containerize.md). + +## Overview + +In this section, you'll learn how to set up a development environment for your containerized application. This includes: + +- Adding a local database and persisting data +- Configuring Compose to automatically update your running Compose services as you edit and save your code + +## Get the sample application + +You'll need to clone a new repository to get a sample application that includes logic to connect to the database. + +1. Change to a directory where you want to clone the repository and run the following command. + + ```console + $ git clone https://github.com/falconcr/docker-ruby-on-rails.git + ``` + +2. In the cloned repository's directory, manually create the following files in your project directory. + + Create a file named `Dockerfile` with the following contents. + + ```dockerfile {collapse=true,title=Dockerfile} + # syntax=docker/dockerfile:1 + + # Use the official Ruby image with version 3.2.0 + FROM ruby:3.2.0 + + # Install dependencies + RUN apt-get update -qq && apt-get install -y \ + nodejs \ + postgresql-client \ + libssl-dev \ + libreadline-dev \ + zlib1g-dev \ + build-essential \ + curl + + # Install rbenv + RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv && \ + echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && \ + echo 'eval "$(rbenv init -)"' >> ~/.bashrc && \ + git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build && \ + echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc + + # Install the specified Ruby version using rbenv + ENV PATH="/root/.rbenv/bin:/root/.rbenv/shims:$PATH" + RUN rbenv install 3.2.0 && rbenv global 3.2.0 + + # Set the working directory + WORKDIR /myapp + + # Copy the Gemfile and Gemfile.lock + COPY Gemfile /myapp/Gemfile + COPY Gemfile.lock /myapp/Gemfile.lock + + # Install Gems dependencies + RUN gem install bundler && bundle install + + # Copy the application code + COPY . /myapp + + # Precompile assets (optional, if using Rails with assets) + RUN bundle exec rake assets:precompile + + # Expose the port the app runs on + EXPOSE 3000 + + # Command to run the server + CMD ["rails", "server", "-b", "0.0.0.0"] + + + +Create a file named `compose.yaml` with the following contents. + +```yaml {collapse=true,title=compose.yaml} +# Comments are provided throughout this file to help you get started. +# If you need more help, visit the Docker Compose reference guide at +# https://docs.docker.com/go/compose-spec-reference/ +version: '3' + services: + web: + build: . + command: bundle exec rails s -b '0.0.0.0' + volumes: + - .:/myapp + ports: + - "3000:3000" +``` + + +Create a file named `.dockerignore` with the following contents. + +```text {collapse=true,title=".dockerignore"} +# Include any files or directories that you don't want to be copied to your +# container here (e.g., local build artifacts, temporary files, etc.). +# +# For more help, visit the .dockerignore file reference guide at +# https://docs.docker.com/go/build-context-dockerignore/ + +# Ignore bundler config +/.bundle + +# Ignore all log files and tempfiles +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore the development and test databases +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore the production secrets file +/config/secrets.yml + +# Ignore all files in the test, spec, and features folders +/test/* +/spec/* +/features/* + +# Ignore system-specific files +*.swp +*.swo +*~ +*.DS_Store + +# Ignore coverage reports +/coverage/* + +# Ignore node modules (if using a JavaScript front-end with Ruby on Rails) +/node_modules + +# Ignore yarn lock file +/yarn.lock + +# Ignore the .git directory and other VCS files +.git +.gitignore + +**/docker-compose* +**/compose.y*ml +**/Dockerfile* +LICENSE +README.md +``` + +## Add a local database and persist data + +You can use containers to set up local services, like a database. In this section, you'll update the `compose.yaml` file to define a database service and a volume to persist data. + +In the cloned repository's directory, open the `compose.yaml` file in an IDE or text editor. Yyou need to add the database password file as an environment variable to the server service and specify the secret file to use . + +The following is the updated `compose.yaml` file. + +```yaml {hl_lines="10-30"} +version: '3' +services: + web: + build: . + command: bundle exec rails s -b '0.0.0.0' + volumes: + - .:/myapp + ports: + - "3000:3000" + depends_on: + - db + secrets: + - db-password + environment: + - POSTGRES_PASSWORD_FILE=/run/secrets/db-password + - RAILS_ENV=development + db: + image: postgres:latest + secrets: + - db-password + environment: + - POSTGRES_PASSWORD_FILE=/run/secrets/db-password + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: +secrets: + db-password: + file: db/password.txt +``` + +> **Note** +> +> To learn more about the instructions in the Compose file, see [Compose file +> reference](/compose/compose-file/). + +Before you run the application using Compose, notice that this Compose file specifies a `password.txt` file to hold the database's password. You must create this file as it's not included in the source repository. + +In the cloned repository's directory, create a new directory named `db` and inside that directory create a file named `password.txt` that contains the password for the database. Using your favorite IDE or text editor, add the following contents to the `password.txt` file. + +```text +mysecretpassword +``` + +Save and close the `password.txt` file. + +You should now have the following contents in your `docker-ruby-on-rails` +directory. + +```text +├── docker-ruby-on-rails/ +├── app +├── bin +├── config +│── db/ +│ │ └─ password.txt +├── lib +├── log +├── public +├── storage +├── test +├── tmp +├── vendor +│ ├── .dockerignore +│ ├── .gitignore +│ ├── confi.ru +│ ├── Gemfile +│ ├── Gemfile.lock +│ ├── compose.yaml +│ ├── Rakefile +│ ├── Dockerfile +│ └── README.md +``` + +Now, run the following `docker compose up` command to start your application. + +```console +$ docker compose up --build +``` + +Refresh http://localhost:3000 in your browser and verify that the Whale items persisted, even after the containers were removed and ran again. + +Press `ctrl+c` in the terminal to stop your application. + +## Automatically update services + +Use Compose Watch to automatically update your running Compose services as you +edit and save your code. For more details about Compose Watch, see [Use Compose +Watch](../../compose/file-watch.md). + +Open your `compose.yaml` file in an IDE or text editor and then add the Compose +Watch instructions. The following is the updated `compose.yaml` file. + +```yaml {hl_lines="17-2 0"} +version: '3' +services: + web: + build: . + command: bundle exec rails s -b '0.0.0.0' + volumes: + - .:/myapp + ports: + - "3000:3000" + depends_on: + - db + secrets: + - db-password + environment: + - POSTGRES_PASSWORD_FILE=/run/secrets/db-password + - RAILS_ENV=development + develop: + watch: + - action: rebuild + path: . + db: + image: postgres:latest + secrets: + - db-password + environment: + - POSTGRES_PASSWORD_FILE=/run/secrets/db-password + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: +secrets: + db-password: + file: db/password.txt +``` + +Run the following command to run your application with Compose Watch. + +```console +$ docker compose watch +``` + +Any changes to the application's source files on your local machine will now be immediately reflected in the running container. + +Open `docker-ruby-on-rails/app/views/whales/index.html.erb` in an IDE or text editor and update the `Whales` string by adding a exclamation marks. + +```diff +-

Whales

++

Whales!

+``` + +Save the changes to `index.html.erb` and then wait a few seconds for the application to rebuild. Go to the application again and verify that the updated text appears. + +Press `ctrl+c` in the terminal to stop your application. + +## Summary + +In this section, you took a look at setting up your Compose file to add a local +database and persist data. You also learned how to use Compose Watch to automatically rebuild and run your container when you update your code. + +Related information: + - [Compose file reference](/compose/compose-file/) + - [Compose file watch](../../compose/file-watch.md) + - [Multi-stage builds](../../build/building/multi-stage.md) + +## Next steps + +In the next section, you'll take a look at how to set up a CI/CD pipeline using GitHub Actions. + +{{< button text="Configure CI/CD" url="configure-ci-cd.md" >}} diff --git a/data/toc.yaml b/data/toc.yaml new file mode 100644 index 00000000000..cb4a23b68b5 --- /dev/null +++ b/data/toc.yaml @@ -0,0 +1,2400 @@ +Guides: +- title: Overview + path: /guides/ +- title: Docker overview + path: /guides/docker-overview/ + +- sectiontitle: "Getting started" + section: + - title: "Overview" + path: /guides/getting-started/ + - title: "Get Docker Desktop" + path: /guides/getting-started/get-docker-desktop/ + - title: "Develop with containers" + path: /guides/getting-started/develop-with-containers/ + - title: "Build and push your first image" + path: /guides/getting-started/build-and-push-first-image/ + - title: "What's next" + path: /guides/getting-started/whats-next/ + +- sectiontitle: "Docker concepts" + section: + - sectiontitle: "The basics" + section: + - title: "What is a container?" + path: /guides/docker-concepts/the-basics/what-is-a-container/ + - title: "What is an image?" + path: /guides/docker-concepts/the-basics/what-is-an-image/ + - title: "What is a registry?" + path: /guides/docker-concepts/the-basics/what-is-a-registry/ + - title: "What is Docker Compose?" + path: /guides/docker-concepts/the-basics/what-is-docker-compose/ + - sectiontitle: "Building images" + section: + - title: "Understanding image layers" + path: /guides/docker-concepts/building-images/understanding-image-layers/ + - title: "Writing a Dockerfile" + path: /guides/docker-concepts/building-images/writing-a-dockerfile/ + - title: "Build, tag and publish an image" + path: /guides/docker-concepts/building-images/build-tag-and-publish-an-image/ + - title: "Using the build cache" + path: /guides/docker-concepts/building-images/using-the-build-cache/ + - title: "Multi-stage builds" + path: /guides/docker-concepts/building-images/multi-stage-builds/ + - sectiontitle: "Running containers" + section: + - title: "Publishing ports" + path: /guides/docker-concepts/running-containers/publishing-ports/ + - title: "Overriding container defaults" + path: /guides/docker-concepts/running-containers/overriding-container-defaults/ + - title: "Persisting container data" + path: /guides/docker-concepts/running-containers/persisting-container-data/ + - title: "Sharing local files with containers" + path: /guides/docker-concepts/running-containers/sharing-local-files/ + - title: "Multi-container applications" + path: /guides/docker-concepts/running-containers/multi-container-applications/ +- sectiontitle: Language-specific guides + section: + - path: /language/ + title: Overview + - sectiontitle: Node.js + section: + - title: "Overview" + path: /language/nodejs/ + - title: "Containerize your app" + path: /language/nodejs/containerize/ + - title: "Develop your app" + path: /language/nodejs/develop/ + - title: "Run your tests" + path: /language/nodejs/run-tests/ + - title: "Configure CI/CD" + path: /language/nodejs/configure-ci-cd/ + - title: "Test your deployment" + path: /language/nodejs/deploy/ + - sectiontitle: Python + section: + - title: "Overview" + path: /language/python/ + - title: "Containerize your app" + path: /language/python/containerize/ + - title: "Develop your app" + path: /language/python/develop/ + - title: "Configure CI/CD" + path: /language/python/configure-ci-cd/ + - title: "Test your deployment" + path: /language/python/deploy/ + - sectiontitle: R + section: + - title: "Overview" + path: /language/r/ + - title: "Containerize your app" + path: /language/r/containerize/ + - title: "Develop your app" + path: /language/r/develop/ + - title: "Configure CI/CD" + path: /language/r/configure-ci-cd/ + - title: "Test your deployment" + path: /language/r/deploy/ + - sectiontitle: Java + section: + - title: "Overview" + path: /language/java/ + - title: "Containerize your app" + path: /language/java/containerize/ + - title: "Develop your app" + path: /language/java/develop/ + - title: "Run your tests" + path: /language/java/run-tests/ + - title: "Configure CI/CD" + path: /language/java/configure-ci-cd/ + - title: "Test your deployment" + path: /language/java/deploy/ + - sectiontitle: Go + section: + - title: "Overview" + path: /language/golang/ + - title: "Build images" + path: /language/golang/build-images/ + - title: "Run containers" + path: /language/golang/run-containers/ + - title: "Develop your app" + path: /language/golang/develop/ + - title: "Run your tests" + path: /language/golang/run-tests/ + - title: "Configure CI/CD" + path: /language/golang/configure-ci-cd/ + - title: "Test your deployment" + path: /language/golang/deploy/ + - sectiontitle: C# (.NET) + section: + - title: "Overview" + path: /language/dotnet/ + - title: "Containerize your app" + path: /language/dotnet/containerize/ + - title: "Develop your app" + path: /language/dotnet/develop/ + - title: "Run your tests" + path: /language/dotnet/run-tests/ + - title: "Configure CI/CD" + path: /language/dotnet/configure-ci-cd/ + - title: "Test your deployment" + path: /language/dotnet/deploy/ + - sectiontitle: C++ + section: + - title: "Overview" + path: /language/cpp/ + - title: "Containerize your app" + path: /language/cpp/containerize/ + - title: "Develop your app" + path: /language/cpp/develop/ + - title: "Configure CI/CD" + path: /language/cpp/configure-ci-cd/ + - title: "Test your deployment" + path: /language/cpp/deploy/ + - sectiontitle: Rust + section: + - title: "Overview" + path: /language/rust/ + - title: "Build images" + path: /language/rust/build-images/ + - title: "Run containers" + path: /language/rust/run-containers/ + - title: "Develop your app" + path: /language/rust/develop/ + - title: "Configure CI/CD" + path: /language/rust/configure-ci-cd/ + - title: "Test your deployment" + path: /language/rust/deploy/ + - sectiontitle: PHP + section: + - title: "Overview" + path: /language/php/ + - title: "Containerize your app" + path: /language/php/containerize/ + - title: "Develop your app" + path: /language/php/develop/ + - title: "Run your tests" + path: /language/php/run-tests/ + - title: "Configure CI/CD" + path: /language/php/configure-ci-cd/ + - title: "Test your deployment" + path: /language/php/deploy/ + - sectiontitle: Ruby + section: + - title: "Overview" + path: /language/ruby/ + - title: "Containerize your app" + path: /language/ruby/containerize/ + - title: "Develop your app" + path: /language/ruby/develop/ + - title: "Configure CI/CD" + path: /language/ruby/configure-ci-cd/ + - title: "Test your deployment" + path: /language/ruby/deploy/ +- sectiontitle: Use-case guides + section: + - path: /guides/use-case/ + title: Overview + - sectiontitle: Machine learning & AI + section: + - sectiontitle: PDF analysis and chat + section: + - path: /guides/use-case/genai-pdf-bot/ + title: Overview + - path: /guides/use-case/genai-pdf-bot/containerize/ + title: Containerize your app + - path: /guides/use-case/genai-pdf-bot/develop/ + title: Develop your app + - path: /guides/use-case/genai-video-bot/ + title: Video transcription and chat + - path: /guides/use-case/tensorflowjs/ + title: Face detection with TensorFlow.js + - sectiontitle: Natural language processing + section: + - path: /guides/use-case/nlp/ + title: Overview + - path: /guides/use-case/nlp/language-translation/ + title: Language translation + - path: /guides/use-case/nlp/named-entity-recognition/ + title: Named entity recognition + - path: /guides/use-case/nlp/sentiment-analysis/ + title: Sentiment analysis + - path: /guides/use-case/nlp/text-classification/ + title: Text classification + - path: /guides/use-case/nlp/text-summarization/ + title: Text summarization + - path: /guides/use-case/jupyter/ + title: Data science with JupyterLab + - path: /scout/guides/vex/ + title: Suppress CVEs with VEX + - path: /guides/use-case/databases/ + title: Use containerized databases + +- sectiontitle: Build with Docker + section: + - path: /build/guide/ + title: Overview + - path: /build/guide/intro/ + title: 1. Introduction + - path: /build/guide/layers/ + title: 2. Layers + - path: /build/guide/multi-stage/ + title: 3. Multi-stage + - path: /build/guide/mounts/ + title: 4. Mounts + - path: /build/guide/build-args/ + title: 5. Build arguments + - path: /build/guide/export/ + title: 6. Export binaries + - path: /build/guide/test/ + title: 7. Test + - path: /build/guide/multi-platform/ + title: 8. Multi-platform + - path: /build/guide/next-steps/ + title: Next steps + +- sectiontitle: Deployment and orchestration + section: + - title: "Overview" + path: /guides/deployment-orchestration/orchestration/ + - title: "Deploy to Kubernetes" + path: /guides/deployment-orchestration/kube-deploy/ + - title: "Deploy to Swarm" + path: /guides/deployment-orchestration/swarm-deploy/ + - title: Cloud integrations + path: /cloud/ + +- sectiontitle: Docker workshop + section: + - title: "Part 1: Overview" + path: /guides/workshop/ + - title: "Part 2: Containerize an application" + path: /guides/workshop/02_our_app/ + - title: "Part 3: Update the application" + path: /guides/workshop/03_updating_app/ + - title: "Part 4: Share the application" + path: /guides/workshop/04_sharing_app/ + - title: "Part 5: Persist the DB" + path: /guides/workshop/05_persisting_data/ + - title: "Part 6: Use bind mounts" + path: /guides/workshop/06_bind_mounts/ + - title: "Part 7: Multi-container apps" + path: /guides/workshop/07_multi_container/ + - title: "Part 8: Use Docker Compose" + path: /guides/workshop/08_using_compose/ + - title: "Part 9: Image-building best practices" + path: /guides/workshop/09_image_best/ + - title: "Part 10: What next?" + path: /guides/workshop/10_what_next/ + + +- path: /guides/resources/ + title: "Educational resources" + +- sectiontitle: Contribute + section: + - path: /contribute/ + title: Contribute to Docker's docs + - sectiontitle: Style guide + section: + - path: /contribute/style/grammar/ + title: Grammar and style + - path: /contribute/style/formatting/ + title: Formatting + - path: /contribute/style/recommended-words/ + title: Recommended word list + - path: /contribute/style/terminology/ + title: Docker terminology + - path: /contribute/style/voice-tone/ + title: Voice and tone + - path: /contribute/file-conventions/ + title: Source file conventions + - path: /contribute/ui/ + title: UI elements in content + - sectiontitle: Useful components + section: + - path: /contribute/components/accordions/ + title: Accordions + - path: /contribute/components/badges/ + title: Badges + - path: /contribute/components/call-outs/ + title: Callouts + - path: /contribute/components/cards/ + title: Cards + - path: /contribute/components/code-blocks/ + title: Code blocks + - path: /contribute/components/icons/ + title: Icons + - path: /contribute/components/images/ + title: Images + - path: /contribute/components/links/ + title: Links + - path: /contribute/components/lists/ + title: Lists + - path: /contribute/components/tables/ + title: Tables + - path: /contribute/components/tabs/ + title: Tabs + - path: /contribute/components/videos/ + title: Videos + - path: /contribute/components/buttons/ + title: Buttons + - path: /contribute/checklist/ + title: Writing checklist + +Reference: +- path: /reference/ + title: Reference documentation +- sectiontitle: CLI reference + section: + - path: /reference/cli/docker/ + title: docker (base command) + - path: /reference/cli/docker/build/ + title: docker build + - sectiontitle: docker builder + section: + - path: /reference/cli/docker/builder/ + title: docker builder + - path: /reference/cli/docker/builder/build/ + title: docker builder build + - path: /reference/cli/docker/builder/prune/ + title: docker builder prune + - sectiontitle: docker buildx + section: + - path: /reference/cli/docker/buildx/ + title: docker buildx + - path: /reference/cli/docker/buildx/bake/ + title: docker buildx bake + - path: /reference/cli/docker/buildx/build/ + title: docker buildx build + - path: /reference/cli/docker/buildx/create/ + title: docker buildx create + - path: /reference/cli/docker/buildx/debug/ + title: docker buildx debug + - path: /reference/cli/docker/buildx/debug/build/ + title: docker buildx debug build + - path: /reference/cli/docker/buildx/du/ + title: docker buildx du + - path: /reference/cli/docker/buildx/imagetools/ + title: docker buildx imagetools + - path: /reference/cli/docker/buildx/imagetools/create/ + title: docker buildx imagetools create + - path: /reference/cli/docker/buildx/imagetools/inspect/ + title: docker buildx imagetools inspect + - path: /reference/cli/docker/buildx/inspect/ + title: docker buildx inspect + - path: /reference/cli/docker/buildx/ls/ + title: docker buildx ls + - path: /reference/cli/docker/buildx/prune/ + title: docker buildx prune + - path: /reference/cli/docker/buildx/rm/ + title: docker buildx rm + - path: /reference/cli/docker/buildx/stop/ + title: docker buildx stop + - path: /reference/cli/docker/buildx/use/ + title: docker buildx use + - path: /reference/cli/docker/buildx/version/ + title: docker buildx version + - sectiontitle: docker checkpoint + section: + - path: /reference/cli/docker/checkpoint/ + title: docker checkpoint + - path: /reference/cli/docker/checkpoint/create/ + title: docker checkpoint create + - path: /reference/cli/docker/checkpoint/ls/ + title: docker checkpoint ls + - path: /reference/cli/docker/checkpoint/rm/ + title: docker checkpoint rm + - sectiontitle: docker compose + section: + - path: /compose/reference/ + title: overview + - path: /reference/cli/docker/compose/alpha/ + title: docker compose alpha + - path: /reference/cli/docker/compose/alpha/dry-run/ + title: docker compose alpha dry-run + - path: /reference/cli/docker/compose/alpha/publish/ + title: docker compose alpha publish + - path: /reference/cli/docker/compose/alpha/scale/ + title: docker compose alpha scale + - path: /reference/cli/docker/compose/alpha/viz/ + title: docker compose alpha viz + - path: /reference/cli/docker/compose/ + title: docker compose + - path: /reference/cli/docker/compose/build/ + title: docker compose build + - path: /reference/cli/docker/compose/config/ + title: docker compose config + - path: /reference/cli/docker/compose/cp/ + title: docker compose cp + - path: /reference/cli/docker/compose/create/ + title: docker compose create + - path: /reference/cli/docker/compose/down/ + title: docker compose down + - path: /reference/cli/docker/compose/events/ + title: docker compose events + - path: /reference/cli/docker/compose/exec/ + title: docker compose exec + - path: /reference/cli/docker/compose/images/ + title: docker compose images + - path: /reference/cli/docker/compose/kill/ + title: docker compose kill + - path: /reference/cli/docker/compose/logs/ + title: docker compose logs + - path: /reference/cli/docker/compose/ls/ + title: docker compose ls + - path: /reference/cli/docker/compose/pause/ + title: docker compose pause + - path: /reference/cli/docker/compose/port/ + title: docker compose port + - path: /reference/cli/docker/compose/ps/ + title: docker compose ps + - path: /reference/cli/docker/compose/pull/ + title: docker compose pull + - path: /reference/cli/docker/compose/push/ + title: docker compose push + - path: /reference/cli/docker/compose/restart/ + title: docker compose restart + - path: /reference/cli/docker/compose/rm/ + title: docker compose rm + - path: /reference/cli/docker/compose/run/ + title: docker compose run + - path: /reference/cli/docker/compose/start/ + title: docker compose start + - path: /reference/cli/docker/compose/stop/ + title: docker compose stop + - path: /reference/cli/docker/compose/top/ + title: docker compose top + - path: /reference/cli/docker/compose/unpause/ + title: docker compose unpause + - path: /reference/cli/docker/compose/up/ + title: docker compose up + - path: /reference/cli/docker/compose/version/ + title: docker compose version + - path: /reference/cli/docker/compose/wait/ + title: docker compose wait + - path: /reference/cli/docker/compose/watch/ + title: docker compose watch + - sectiontitle: docker config + section: + - path: /reference/cli/docker/config/ + title: docker config + - path: /reference/cli/docker/config/create/ + title: docker config create + - path: /reference/cli/docker/config/inspect/ + title: docker config inspect + - path: /reference/cli/docker/config/ls/ + title: docker config ls + - path: /reference/cli/docker/config/rm/ + title: docker config rm + - sectiontitle: docker container + section: + - path: /reference/cli/docker/container/ + title: docker container + - path: /reference/cli/docker/container/attach/ + title: docker container attach + - path: /reference/cli/docker/container/commit/ + title: docker container commit + - path: /reference/cli/docker/container/cp/ + title: docker container cp + - path: /reference/cli/docker/container/create/ + title: docker container create + - path: /reference/cli/docker/container/diff/ + title: docker container diff + - path: /reference/cli/docker/container/exec/ + title: docker container exec + - path: /reference/cli/docker/container/export/ + title: docker container export + - path: /reference/cli/docker/container/inspect/ + title: docker container inspect + - path: /reference/cli/docker/container/kill/ + title: docker container kill + - path: /reference/cli/docker/container/logs/ + title: docker container logs + - path: /reference/cli/docker/container/ls/ + title: docker container ls + - path: /reference/cli/docker/container/pause/ + title: docker container pause + - path: /reference/cli/docker/container/port/ + title: docker container port + - path: /reference/cli/docker/container/prune/ + title: docker container prune + - path: /reference/cli/docker/container/rename/ + title: docker container rename + - path: /reference/cli/docker/container/restart/ + title: docker container restart + - path: /reference/cli/docker/container/rm/ + title: docker container rm + - path: /reference/cli/docker/container/run/ + title: docker container run + - path: /reference/cli/docker/container/start/ + title: docker container start + - path: /reference/cli/docker/container/stats/ + title: docker container stats + - path: /reference/cli/docker/container/stop/ + title: docker container stop + - path: /reference/cli/docker/container/top/ + title: docker container top + - path: /reference/cli/docker/container/unpause/ + title: docker container unpause + - path: /reference/cli/docker/container/update/ + title: docker container update + - path: /reference/cli/docker/container/wait/ + title: docker container wait + - sectiontitle: docker context + section: + - path: /reference/cli/docker/context/ + title: docker context + - path: /reference/cli/docker/context/create/ + title: docker context create + - path: /reference/cli/docker/context/export/ + title: docker context export + - path: /reference/cli/docker/context/import/ + title: docker context import + - path: /reference/cli/docker/context/inspect/ + title: docker context inspect + - path: /reference/cli/docker/context/ls/ + title: docker context ls + - path: /reference/cli/docker/context/rm/ + title: docker context rm + - path: /reference/cli/docker/context/show/ + title: docker context show + - path: /reference/cli/docker/context/update/ + title: docker context update + - path: /reference/cli/docker/context/use/ + title: docker context use + - path: /reference/cli/docker/debug/ + title: docker debug (Beta) + - path: /reference/cli/docker/exec/ + title: docker exec + - sectiontitle: docker image + section: + - path: /reference/cli/docker/image/ + title: docker image + - path: /reference/cli/docker/image/build/ + title: docker image build + - path: /reference/cli/docker/image/history/ + title: docker image history + - path: /reference/cli/docker/image/import/ + title: docker image import + - path: /reference/cli/docker/image/inspect/ + title: docker image inspect + - path: /reference/cli/docker/image/load/ + title: docker image load + - path: /reference/cli/docker/image/ls/ + title: docker image ls + - path: /reference/cli/docker/image/prune/ + title: docker image prune + - path: /reference/cli/docker/image/pull/ + title: docker image pull + - path: /reference/cli/docker/image/push/ + title: docker image push + - path: /reference/cli/docker/image/rm/ + title: docker image rm + - path: /reference/cli/docker/image/save/ + title: docker image save + - path: /reference/cli/docker/image/tag/ + title: docker image tag + - path: /reference/cli/docker/images/ + title: docker images + - path: /reference/cli/docker/info/ + title: docker info + - path: /reference/cli/docker/init/ + title: docker init + - path: /reference/cli/docker/inspect/ + title: docker inspect + - path: /reference/cli/docker/login/ + title: docker login + - path: /reference/cli/docker/logout/ + title: docker logout + - sectiontitle: docker manifest + section: + - path: /reference/cli/docker/manifest/ + title: docker manifest + - path: /reference/cli/docker/manifest/annotate/ + title: docker manifest annotate + - path: /reference/cli/docker/manifest/create/ + title: docker manifest create + - path: /reference/cli/docker/manifest/inspect/ + title: docker manifest inspect + - path: /reference/cli/docker/manifest/push/ + title: docker manifest push + - path: /reference/cli/docker/manifest/rm/ + title: docker manifest rm + - sectiontitle: docker network + section: + - path: /reference/cli/docker/network/ + title: docker network + - path: /reference/cli/docker/network/connect/ + title: docker network connect + - path: /reference/cli/docker/network/create/ + title: docker network create + - path: /reference/cli/docker/network/disconnect/ + title: docker network disconnect + - path: /reference/cli/docker/network/inspect/ + title: docker network inspect + - path: /reference/cli/docker/network/ls/ + title: docker network ls + - path: /reference/cli/docker/network/prune/ + title: docker network prune + - path: /reference/cli/docker/network/rm/ + title: docker network rm + - sectiontitle: docker node + section: + - path: /reference/cli/docker/node/ + title: docker node + - path: /reference/cli/docker/node/demote/ + title: docker node demote + - path: /reference/cli/docker/node/inspect/ + title: docker node inspect + - path: /reference/cli/docker/node/ls/ + title: docker node ls + - path: /reference/cli/docker/node/promote/ + title: docker node promote + - path: /reference/cli/docker/node/ps/ + title: docker node ps + - path: /reference/cli/docker/node/rm/ + title: docker node rm + - path: /reference/cli/docker/node/update/ + title: docker node update + - sectiontitle: docker plugin + section: + - path: /reference/cli/docker/plugin/ + title: docker plugin + - path: /reference/cli/docker/plugin/create/ + title: docker plugin create + - path: /reference/cli/docker/plugin/disable/ + title: docker plugin disable + - path: /reference/cli/docker/plugin/enable/ + title: docker plugin enable + - path: /reference/cli/docker/plugin/inspect/ + title: docker plugin inspect + - path: /reference/cli/docker/plugin/install/ + title: docker plugin install + - path: /reference/cli/docker/plugin/ls/ + title: docker plugin ls + - path: /reference/cli/docker/plugin/rm/ + title: docker plugin rm + - path: /reference/cli/docker/plugin/set/ + title: docker plugin set + - path: /reference/cli/docker/plugin/upgrade/ + title: docker plugin upgrade + - path: /reference/cli/docker/ps/ + title: docker ps + - path: /reference/cli/docker/pull/ + title: docker pull + - path: /reference/cli/docker/push/ + title: docker push + - path: /reference/cli/docker/run/ + title: docker run + - sectiontitle: docker scout + section: + - path: /reference/cli/docker/scout/ + title: docker scout + - path: /reference/cli/docker/scout/attestation/ + title: docker scout attestation + - path: /reference/cli/docker/scout/attestation/add/ + title: docker scout attestation add + - path: /reference/cli/docker/scout/cache/ + title: docker scout cache + - path: /reference/cli/docker/scout/cache/df/ + title: docker scout cache df + - path: /reference/cli/docker/scout/cache/prune/ + title: docker scout cache prune + - path: /reference/cli/docker/scout/compare/ + title: docker scout compare + - path: /reference/cli/docker/scout/config/ + title: docker scout config + - path: /reference/cli/docker/scout/cves/ + title: docker scout cves + - path: /reference/cli/docker/scout/enroll/ + title: docker scout enroll + - path: /reference/cli/docker/scout/environment/ + title: docker scout environment + - path: /reference/cli/docker/scout/integration/ + title: docker scout integration + - path: /reference/cli/docker/scout/integration/configure/ + title: docker scout integration configure + - path: /reference/cli/docker/scout/integration/delete/ + title: docker scout integration delete + - path: /reference/cli/docker/scout/integration/list/ + title: docker scout integration list + - path: /reference/cli/docker/scout/policy/ + title: docker scout policy + - path: /reference/cli/docker/scout/push/ + title: docker scout push + - path: /reference/cli/docker/scout/quickview/ + title: docker scout quickview + - path: /reference/cli/docker/scout/recommendations/ + title: docker scout recommendations + - path: /reference/cli/docker/scout/repo/ + title: docker scout repo + - path: /reference/cli/docker/scout/repo/disable/ + title: docker scout repo disable + - path: /reference/cli/docker/scout/repo/enable/ + title: docker scout repo enable + - path: /reference/cli/docker/scout/repo/list/ + title: docker scout repo list + - path: /reference/cli/docker/scout/sbom/ + title: docker scout sbom + - path: /reference/cli/docker/scout/stream/ + title: docker scout stream + - path: /reference/cli/docker/scout/version/ + title: docker scout version + - path: /reference/cli/docker/scout/watch/ + title: docker scout watch + - path: /reference/cli/docker/search/ + title: docker search + - sectiontitle: docker secret + section: + - path: /reference/cli/docker/secret/ + title: docker secret + - path: /reference/cli/docker/secret/create/ + title: docker secret create + - path: /reference/cli/docker/secret/inspect/ + title: docker secret inspect + - path: /reference/cli/docker/secret/ls/ + title: docker secret ls + - path: /reference/cli/docker/secret/rm/ + title: docker secret rm + - sectiontitle: docker service + section: + - path: /reference/cli/docker/service/ + title: docker service + - path: /reference/cli/docker/service/create/ + title: docker service create + - path: /reference/cli/docker/service/inspect/ + title: docker service inspect + - path: /reference/cli/docker/service/logs/ + title: docker service logs + - path: /reference/cli/docker/service/ls/ + title: docker service ls + - path: /reference/cli/docker/service/ps/ + title: docker service ps + - path: /reference/cli/docker/service/rollback/ + title: docker service rollback + - path: /reference/cli/docker/service/rm/ + title: docker service rm + - path: /reference/cli/docker/service/scale/ + title: docker service scale + - path: /reference/cli/docker/service/update/ + title: docker service update + - sectiontitle: docker stack + section: + - path: /reference/cli/docker/stack/ + title: docker stack + - path: /reference/cli/docker/stack/config/ + title: docker stack config + - path: /reference/cli/docker/stack/deploy/ + title: docker stack deploy + - path: /reference/cli/docker/stack/ls/ + title: docker stack ls + - path: /reference/cli/docker/stack/ps/ + title: docker stack ps + - path: /reference/cli/docker/stack/rm/ + title: docker stack rm + - path: /reference/cli/docker/stack/services/ + title: docker stack services + - sectiontitle: docker swarm + section: + - path: /reference/cli/docker/swarm/ + title: docker swarm + - path: /reference/cli/docker/swarm/ca/ + title: docker swarm ca + - path: /reference/cli/docker/swarm/init/ + title: docker swarm init + - path: /reference/cli/docker/swarm/join-token/ + title: docker swarm join-token + - path: /reference/cli/docker/swarm/join/ + title: docker swarm join + - path: /reference/cli/docker/swarm/leave/ + title: docker swarm leave + - path: /reference/cli/docker/swarm/unlock-key/ + title: docker swarm unlock-key + - path: /reference/cli/docker/swarm/unlock/ + title: docker swarm unlock + - path: /reference/cli/docker/swarm/update/ + title: docker swarm update + - sectiontitle: docker system + section: + - path: /reference/cli/docker/system/ + title: docker system + - path: /reference/cli/docker/system/df/ + title: docker system df + - path: /reference/cli/docker/system/events/ + title: docker system events + - path: /reference/cli/docker/system/info/ + title: docker system info + - path: /reference/cli/docker/system/prune/ + title: docker system prune + - sectiontitle: docker trust + section: + - path: /reference/cli/docker/trust/ + title: docker trust + - path: /reference/cli/docker/trust/inspect/ + title: docker trust inspect + - path: /reference/cli/docker/trust/key/ + title: docker trust key + - path: /reference/cli/docker/trust/key/generate/ + title: docker trust key generate + - path: /reference/cli/docker/trust/key/load/ + title: docker trust key load + - path: /reference/cli/docker/trust/revoke/ + title: docker trust revoke + - path: /reference/cli/docker/trust/sign/ + title: docker trust sign + - path: /reference/cli/docker/trust/signer/ + title: docker trust signer + - path: /reference/cli/docker/trust/signer/add/ + title: docker trust signer add + - path: /reference/cli/docker/trust/signer/remove/ + title: docker trust signer remove + - path: /reference/cli/docker/version/ + title: docker version + - sectiontitle: docker volume + section: + - path: /reference/cli/docker/volume/create/ + title: docker volume create + - path: /reference/cli/docker/volume/inspect/ + title: docker volume inspect + - path: /reference/cli/docker/volume/ls/ + title: docker volume ls + - path: /reference/cli/docker/volume/prune/ + title: docker volume prune + - path: /reference/cli/docker/volume/rm/ + title: docker volume rm + - path: /reference/cli/docker/volume/update/ + title: docker volume update +- title: Dockerfile reference + path: /reference/dockerfile/ +- sectiontitle: Build checks + section: + - path: /reference/build-checks/ + title: Overview + - path: /reference/build-checks/stage-name-casing/ + title: StageNameCasing + - path: /reference/build-checks/from-as-casing/ + title: FromAsCasing + - path: /reference/build-checks/no-empty-continuation/ + title: NoEmptyContinuation + - path: /reference/build-checks/consistent-instruction-casing/ + title: ConsistentInstructionCasing + - path: /reference/build-checks/file-consistent-command-casing/ + title: FileConsistentCommandCasing + - path: /reference/build-checks/duplicate-stage-name/ + title: DuplicateStageName + - path: /reference/build-checks/reserved-stage-name/ + title: ReservedStageName + - path: /reference/build-checks/json-args-recommended/ + title: JSONArgsRecommended + - path: /reference/build-checks/maintainer-deprecated/ + title: MaintainerDeprecated + - path: /reference/build-checks/undefined-arg-in-from/ + title: UndefinedArgInFrom + - path: /reference/build-checks/workdir-relative-path/ + title: WorkdirRelativePath + - path: /reference/build-checks/undefined-var/ + title: UndefinedVar + - path: /reference/build-checks/multiple-instructions-disallowed/ + title: MultipleInstructionsDisallowed + - path: /reference/build-checks/legacy-key-value-format/ + title: LegacyKeyValueFormat +- title: Daemon CLI (dockerd) + path: /reference/cli/dockerd/ +- sectiontitle: API reference + section: + - sectiontitle: Docker Engine API + section: + - path: /engine/api/ + title: Overview + - path: /engine/api/sdk/ + title: SDKs + - path: /engine/api/sdk/examples/ + title: SDK examples + - path: /engine/api/latest/ + title: v{{< param latest_engine_api_version >}} reference (latest) + - sectiontitle: API reference by version + section: + - path: /engine/api/version-history/ + title: Version history overview + - path: /engine/api/v1.46/ + title: v1.46 reference + - path: /engine/api/v1.45/ + title: v1.45 reference + - path: /engine/api/v1.44/ + title: v1.44 reference + - path: /engine/api/v1.43/ + title: v1.43 reference + - path: /engine/api/v1.42/ + title: v1.42 reference + - path: /engine/api/v1.41/ + title: v1.41 reference + - path: /engine/api/v1.40/ + title: v1.40 reference + - path: /engine/api/v1.39/ + title: v1.39 reference + - path: /engine/api/v1.38/ + title: v1.38 reference + - path: /engine/api/v1.37/ + title: v1.37 reference + - path: /engine/api/v1.36/ + title: v1.36 reference + - path: /engine/api/v1.35/ + title: v1.35 reference + - path: /engine/api/v1.34/ + title: v1.34 reference + - path: /engine/api/v1.33/ + title: v1.33 reference + - path: /engine/api/v1.32/ + title: v1.32 Reference + - path: /engine/api/v1.31/ + title: v1.31 Reference + - path: /engine/api/v1.30/ + title: v1.30 Reference + - path: /engine/api/v1.29/ + title: v1.29 Reference + - path: /engine/api/v1.28/ + title: v1.28 reference + - path: /engine/api/v1.27/ + title: v1.27 reference + - path: /engine/api/v1.26/ + title: v1.26 reference + - path: /engine/api/v1.25/ + title: v1.25 reference + - path: /engine/api/v1.24/ + title: v1.24 reference + - sectiontitle: Docker Hub API + section: + - title: Docker Hub API + path: /docker-hub/api/latest/ + - title: DVP Data API + path: /docker-hub/api/dvp/ + - title: Deprecated API + path: /docker-hub/api/deprecated/ + - sectiontitle: Docker Extension SDK API + section: + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/DesktopUI/ + title: DesktopUI + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/Dialog/ + title: Dialog + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/Docker/ + title: Docker + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/DockerCommand/ + title: DockerCommand + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/DockerDesktopClient/ + title: DockerDesktopClient + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/Exec/ + title: Exec + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/ExecProcess/ + title: ExecProcess + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/ExecResult/ + title: ExecResult + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/ExecStreamOptions/ + title: ExecStreamOptions + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/Extension/ + title: Extension + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/ExtensionCli/ + title: ExtensionCli + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/ExtensionHost/ + title: ExtensionHost + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/ExtensionVM/ + title: ExtensionVM + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/Host/ + title: Host + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/HttpService/ + title: HttpService + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/NavigationIntents/ + title: NavigationIntents + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/OpenDialogResult/ + title: OpenDialogResult + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/RawExecResult/ + title: RawExecResult + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/RequestConfig/ + title: RequestConfig + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/RequestConfigV0/ + title: RequestConfigV0 + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/Toast/ + title: Toast + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/ExecResultV0/ + title: ExecResultV0 + - path: /desktop/extensions-sdk/dev/api/reference/interfaces/BackendV0/ + title: BackendV0 +- sectiontitle: Compose file reference + section: + - sectiontitle: Compose Specification + section: + - path: /compose/compose-file/ + title: Overview + - path: /compose/compose-file/04-version-and-name/ + title: Version and name top-level element + - path: /compose/compose-file/05-services/ + title: Services top-level element + - path: /compose/compose-file/06-networks/ + title: Network top-level element + - path: /compose/compose-file/07-volumes/ + title: Volumes top-level element + - path: /compose/compose-file/08-configs/ + title: Configs top-level element + - path: /compose/compose-file/09-secrets/ + title: Secrets top-level element + - path: /compose/compose-file/10-fragments/ + title: Fragments + - path: /compose/compose-file/11-extension/ + title: Extensions + - path: /compose/compose-file/12-interpolation/ + title: Interpolation + - path: /compose/compose-file/13-merge/ + title: Merge + - path: /compose/compose-file/14-include/ + title: Include + - path: /compose/compose-file/15-profiles/ + title: Profiles + - path: /compose/compose-file/build/ + title: Compose Build Specification + - path: /compose/compose-file/deploy/ + title: Compose Deploy Specification + - path: /compose/compose-file/develop/ + title: Compose Develop Specification + - path: /compose/compose-file/legacy-versions/ + title: Legacy versions +- path: /glossary/ + title: Glossary +- sectiontitle: Samples + section: + - path: /samples/ + title: Overview + - sectiontitle: Databases + section: + - path: /samples/mariadb/ + title: MariaDB + - path: /samples/mongodb/ + title: MongoDB + - path: /samples/ms-sql/ + title: MS-SQL + - path: /samples/mysql/ + title: MySQL + - path: /samples/postgres/ + title: PostgreSQL + - path: /samples/redis/ + title: Redis + - sectiontitle: Frameworks + section: + - path: /samples/dotnet/ + title: .NET + - path: /samples/angular/ + title: Angular + - path: /samples/django/ + title: Django + - path: /samples/express/ + title: Express + - path: /samples/fastapi/ + title: FastAPI + - path: /samples/flask/ + title: Flask + - path: /samples/nodejs/ + title: Node.js + - path: /samples/react/ + title: React + - path: /samples/rails/ + title: Rails + - path: /samples/spark/ + title: Spark + - path: /samples/spring/ + title: Spring Boot + - path: /samples/vuejs/ + title: Vue.js + - sectiontitle: Languages + section: + - path: /samples/go/ + title: Go + - path: /samples/java/ + title: Java + - path: /samples/javascript/ + title: JavaScript + - path: /samples/php/ + title: PHP + - path: /samples/python/ + title: Python + - path: /samples/ruby/ + title: Ruby + - path: /samples/rust/ + title: Rust + - path: /samples/typescript/ + title: TypeScript + - sectiontitle: Platforms + section: + - path: /samples/gitea/ + title: Gitea + - path: /samples/nextcloud/ + title: Nextcloud + - path: /samples/portainer/ + title: Portainer + - path: /samples/prometheus/ + title: Prometheus + - path: /samples/wordpress/ + title: WordPress + - sectiontitle: Other samples + section: + - path: /samples/ai-ml/ + title: AI/ML + - path: /samples/cloudflared/ + title: Cloudflared + - path: /samples/elasticsearch/ + title: Elasticsearch / Logstash / Kibana + - path: /samples/minecraft/ + title: Minecraft + - path: /samples/nginx/ + title: NGINX + - path: /samples/pi-hole/ + title: Pi-hole + - path: /samples/plex/ + title: Plex + - path: /samples/traefik/ + title: Traefik + - path: /samples/wireguard/ + title: Wireguard + +Manuals: +- path: /manuals/ + title: Overview +- title: Get Docker + path: /get-docker/ +- sectiontitle: Docker Desktop + section: + - path: /desktop/ + title: Overview + - sectiontitle: Install + section: + - path: /desktop/install/mac-install/ + title: Mac + - path: /desktop/mac/permission-requirements/ + title: Understand permission requirements for Mac + - path: /desktop/install/windows-install/ + title: Windows + - path: /desktop/windows/permission-requirements/ + title: Understand permission requirements for Windows + - path: /desktop/install/linux-install/ + title: Linux + - sectiontitle: Installation per Linux distro + section: + - path: /desktop/install/ubuntu/ + title: Ubuntu + - path: /desktop/install/debian/ + title: Debian + - path: /desktop/install/fedora/ + title: Fedora + - path: /desktop/install/archlinux/ + title: Arch + - path: /desktop/get-started/ + title: Sign in + - sectiontitle: Explore Docker Desktop + section: + - path: /desktop/use-desktop/ + title: Overview + - path: /desktop/use-desktop/container/ + title: Explore Containers + - path: /desktop/use-desktop/images/ + title: Explore Images + - path: /desktop/use-desktop/volumes/ + title: Explore Volumes + - path: /desktop/use-desktop/builds/ + title: Explore Builds + - path: /desktop/use-desktop/resource-saver/ + title: Resource Saver mode + - path: /desktop/use-desktop/pause/ + title: Pause Docker Desktop + - sectiontitle: Hardened Docker Desktop + section: + - path: /desktop/hardened-desktop/ + title: Overview + - sectiontitle: Settings Management + section: + - path: /desktop/hardened-desktop/settings-management/ + title: What is Settings Management? + - path: /desktop/hardened-desktop/settings-management/configure/ + title: Configure Settings Management + - sectiontitle: Enhanced Container Isolation + section: + - path: /desktop/hardened-desktop/enhanced-container-isolation/ + title: What is Enhanced Container Isolation? + - path: /desktop/hardened-desktop/enhanced-container-isolation/how-eci-works/ + title: How does it work? + - path: /desktop/hardened-desktop/enhanced-container-isolation/features-benefits/ + title: Key features and benefits + - path: /desktop/hardened-desktop/enhanced-container-isolation/config/ + title: Advanced configuration options + - path: /desktop/hardened-desktop/enhanced-container-isolation/limitations/ + title: Limitations + - path: /desktop/hardened-desktop/enhanced-container-isolation/faq/ + title: FAQ + - path: /desktop/hardened-desktop/air-gapped-containers/ + title: Air-Gapped Containers + - sectiontitle: Dev Environments (Beta) + section: + - path: /desktop/dev-environments/ + title: Overview + - path: /desktop/dev-environments/create-dev-env/ + title: Launch a dev environment + - path: /desktop/dev-environments/set-up/ + title: Set up a dev environment + - path: /desktop/dev-environments/share/ + title: Distribute your dev environment + - path: /desktop/dev-environments/dev-cli/ + title: Use the docker dev CLI plugin + - path: /desktop/containerd/ + title: containerd image store + - path: /desktop/wasm/ + title: Wasm workloads (Beta) + - path: /desktop/synchronized-file-sharing/ + title: Synchronized file shares + - sectiontitle: WSL + section: + - path: /desktop/wsl/ + title: Set up WSL 2 on Docker Desktop for Windows + - path: /desktop/wsl/use-wsl/ + title: Use WSL + - path: /desktop/wsl/best-practices/ + title: Best practices + - path: /desktop/gpu/ + title: GPU support + - sectiontitle: Additional resources + section: + - path: /desktop/kubernetes/ + title: Deploy on Kubernetes + - path: /desktop/backup-and-restore/ + title: Back up and restore data + - path: /desktop/networking/ + title: Explore networking features + - path: /desktop/vm-vdi/ + title: Run Docker Desktop for Windows in a VM or VDI environment + - path: /desktop/allow-list/ + title: Allowlist for Docker Desktop + - sectiontitle: Change settings + section: + - path: /desktop/settings/mac/ + title: On Mac + - path: /desktop/settings/windows/ + title: On Windows + - path: /desktop/settings/linux/ + title: On Linux + - sectiontitle: Troubleshoot and diagnose + section: + - path: /desktop/troubleshoot/overview/ + title: Overview + - path: /desktop/troubleshoot/topics/ + title: Troubleshoot topics + - path: /desktop/troubleshoot/workarounds/ + title: Workarounds for common problems + - path: /desktop/troubleshoot/known-issues/ + title: Known issues + - path: /desktop/uninstall/ + title: Uninstall Docker Desktop + - path: /desktop/feedback/ + title: Give feedback + - sectiontitle: Desktop FAQs + section: + - path: /desktop/faqs/general/ + title: General + - path: /desktop/faqs/macfaqs/ + title: Mac + - path: /desktop/faqs/windowsfaqs/ + title: Windows + - path: /desktop/faqs/linuxfaqs/ + title: Linux + - path: /desktop/faqs/releases/ + title: Releases + - path: /desktop/release-notes/ + title: Release notes + - sectiontitle: Previous versions + section: + - path: /desktop/previous-versions/3.x-windows/ + title: Desktop for Windows 3.x + - path: /desktop/previous-versions/3.x-mac/ + title: Desktop for Mac 3.x + - path: /desktop/previous-versions/2.x-windows/ + title: Desktop for Windows 2.x + - path: /desktop/previous-versions/2.x-mac/ + title: Desktop for Mac 2.x + - path: /desktop/previous-versions/edge-releases-windows/ + title: Windows edge releases + - path: /desktop/previous-versions/edge-releases-mac/ + title: Mac edge releases + - path: /desktop/previous-versions/archive-windows/ + title: Older versions for Windows + - path: /desktop/previous-versions/archive-mac/ + title: Older versions for Mac + +- sectiontitle: Docker Extensions + section: + - path: /desktop/extensions/ + title: Overview + - sectiontitle: Extensions on Docker Desktop + section: + - path: /desktop/extensions/marketplace/ + title: Manage Marketplace extensions + - path: /desktop/extensions/non-marketplace/ + title: Manage non-Marketplace extensions + - path: /desktop/extensions/settings-feedback/ + title: Change settings and give feedback + - path: /desktop/extensions/private-marketplace/ + title: Configure a private Marketplace (Beta) + - sectiontitle: Extensions SDK + section: + - path: /desktop/extensions-sdk/ + title: Overview + - path: /desktop/extensions-sdk/process/ + title: The build and publish process + - path: /desktop/extensions-sdk/quickstart/ + title: Quickstart + - sectiontitle: "Part one: Build" + section: + - title: Create a simple extension + path: /desktop/extensions-sdk/build/minimal-frontend-extension/ + - title: Create an advanced frontend extension + path: /desktop/extensions-sdk/build/frontend-extension-tutorial/ + - title: Add a backend to your extension + path: /desktop/extensions-sdk/build/backend-extension-tutorial/ + - sectiontitle: "Part two: Publish" + section: + - title: Overview + path: /desktop/extensions-sdk/extensions/ + - title: Labels + path: /desktop/extensions-sdk/extensions/labels/ + - title: Validate + path: /desktop/extensions-sdk/extensions/validate/ + - title: Package and release your extension + path: /desktop/extensions-sdk/extensions/DISTRIBUTION/ + - title: Generate a share link + path: /desktop/extensions-sdk/extensions/share/ + - title: Publish in the Marketplace + path: /desktop/extensions-sdk/extensions/publish/ + - title: Build multi-arch extensions + path: /desktop/extensions-sdk/extensions/multi-arch/ + - sectiontitle: "Architecture" + section: + - title: Overview + path: /desktop/extensions-sdk/architecture/ + - title: Metadata + path: /desktop/extensions-sdk/architecture/metadata/ + - title: Security + path: /desktop/extensions-sdk/architecture/security/ + - sectiontitle: "Design and UI styling" + section: + - title: UI styling guidelines + path: /desktop/extensions-sdk/design/ + - title: Guidelines + path: /desktop/extensions-sdk/design/design-guidelines/ + - title: Docker design principles + path: /desktop/extensions-sdk/design/design-principles/ + - title: MUI best practices + path: /desktop/extensions-sdk/design/mui-best-practices/ + - sectiontitle: "Developer Guides" + section: + - title: Invoke host binaries + path: /desktop/extensions-sdk/guides/invoke-host-binaries/ + - title: Use the Docker socket from the extension backend + path: /desktop/extensions-sdk/guides/use-docker-socket-from-backend/ + - title: Interacting with Kubernetes + path: /desktop/extensions-sdk/guides/kubernetes/ + - title: Authentication + path: /desktop/extensions-sdk/guides/oauth2-flow/ + - sectiontitle: Developer SDK tools + section: + - title: "Test and debug" + path: /desktop/extensions-sdk/dev/test-debug/ + - title: "Continuous integration" + path: /desktop/extensions-sdk/dev/continuous-integration/ + - title: CLI reference + path: /desktop/extensions-sdk/dev/usage/ + - sectiontitle: Extension APIs + section: + - title: Overview + path: /desktop/extensions-sdk/dev/api/overview/ + - title: Extension Backend + path: /desktop/extensions-sdk/dev/api/backend/ + - title: Docker + path: /desktop/extensions-sdk/dev/api/docker/ + - title: Dashboard + path: /desktop/extensions-sdk/dev/api/dashboard/ + - title: Navigation + path: /desktop/extensions-sdk/dev/api/dashboard-routes-navigation/ + - title: API Reference + path: /desktop/extensions-sdk/dev/api/reference/README/ + +- sectiontitle: Docker Scout + section: + - path: /scout/ + title: Overview + - path: /scout/quickstart/ + title: Quickstart + - path: /scout/install/ + title: Install + - sectiontitle: Concepts + section: + - path: /scout/concepts/s3c/ + title: Software supply chain security + - path: /scout/concepts/sbom/ + title: Software Bill of Materials + - sectiontitle: Explore + section: + - path: /scout/explore/analysis/ + title: Analysis + - path: /scout/explore/dashboard/ + title: Dashboard + - path: /scout/explore/image-details-view/ + title: Image details view + - path: /scout/explore/exceptions/ + title: Exceptions {{< badge color=violet text=New >}} + - path: /scout/explore/metrics-exporter/ + title: Metrics exporter + - sectiontitle: How-tos + section: + - path: /scout/how-tos/artifact-types/ + title: Specify artifact type or location + - path: /scout/how-tos/view-create-sboms/ + title: View and create SBOMs + - path: /scout/how-tos/configure-cli/ + title: Configure the CLI + - sectiontitle: Deep dive + section: + - path: /scout/deep-dive/advisory-db-sources/ + title: Advisory database + - path: /scout/deep-dive/data-handling/ + title: Data handling + - sectiontitle: Policy Evaluation + section: + - path: /scout/policy/ + title: Overview + - path: /scout/policy/scores/ + title: Health scores {{< badge color=blue text=Beta >}} + - path: /scout/policy/view/ + title: View policy status + - path: /scout/policy/configure/ + title: Configure policies + - path: /scout/policy/ci/ + title: Policy Evaluation in CI + - path: /scout/policy/remediation/ + title: Remediation + - sectiontitle: Integrations + section: + - title: Overview + path: /scout/integrations/ + - sectiontitle: Environment monitoring + section: + - title: Overview + path: /scout/integrations/environment/ + - title: Sysdig + path: /scout/integrations/environment/sysdig/ + - title: Generic + path: /scout/integrations/environment/cli/ + - sectiontitle: Container registries + section: + - title: Artifactory + path: /scout/integrations/registry/artifactory/ + - title: Elastic Container Registry + path: /scout/integrations/registry/ecr/ + - title: Azure Container Registry + path: /scout/integrations/registry/acr/ + - sectiontitle: Continuous integration + section: + - title: GitHub Actions + path: /scout/integrations/ci/gha/ + - title: GitLab + path: /scout/integrations/ci/gitlab/ + - title: Microsoft Azure DevOps Pipelines + path: /scout/integrations/ci/azure/ + - title: Circle CI + path: /scout/integrations/ci/circle-ci/ + - title: Jenkins + path: /scout/integrations/ci/jenkins/ + - sectiontitle: Code quality + section: + - title: SonarQube + path: /scout/integrations/code-quality/sonarqube/ + - sectiontitle: Source code management + section: + - title: GitHub + path: /scout/integrations/source-code-management/github/ + - sectiontitle: Team collaboration + section: + - title: Slack + path: /scout/integrations/team-collaboration/slack/ + - sectiontitle: Release notes + section: + - path: /scout/release-notes/cli/ + title: CLI and GitHub Action + - path: /scout/release-notes/platform/ + title: Platform + +- sectiontitle: Docker Engine + section: + - path: /engine/ + title: Overview + - sectiontitle: Install + section: + - path: /engine/install/ + title: Overview + - path: /engine/install/centos/ + title: CentOS + - path: /engine/install/debian/ + title: Debian + - path: /engine/install/fedora/ + title: Fedora + - path: /engine/install/rhel/ + title: RHEL + - path: /engine/install/sles/ + title: SLES + - path: /engine/install/ubuntu/ + title: Ubuntu + - path: /engine/install/raspberry-pi-os/ + title: Raspberry Pi OS (32-bit) + - path: /engine/install/binaries/ + title: Binaries + - path: /engine/install/linux-postinstall/ + title: Post-installation steps + - sectiontitle: Storage + section: + - path: /storage/ + title: Overview + - path: /storage/volumes/ + title: Volumes + - path: /storage/bind-mounts/ + title: Bind mounts + - path: /storage/tmpfs/ + title: tmpfs mounts + - sectiontitle: Storage drivers + section: + - path: /storage/storagedriver/ + title: Overview + - path: /storage/storagedriver/select-storage-driver/ + title: Select a storage driver + - path: /storage/storagedriver/btrfs-driver/ + title: Use the Btrfs storage driver + - path: /storage/storagedriver/device-mapper-driver/ + title: Use the Device mapper storage driver + - path: /storage/storagedriver/overlayfs-driver/ + title: Use the OverlayFS storage driver + - path: /storage/storagedriver/zfs-driver/ + title: Use the ZFS storage driver + - path: /storage/storagedriver/vfs-driver/ + title: Use the VFS storage driver + - path: /storage/storagedriver/aufs-driver/ + title: Use the AUFS storage driver (deprecated) + - path: /storage/containerd/ + title: containerd snapshotters + - sectiontitle: Networking + section: + - path: /network/ + title: Overview + - sectiontitle: Network drivers + section: + - path: /network/drivers/ + title: Overview + - path: /network/drivers/bridge/ + title: Bridge + - path: /network/drivers/overlay/ + title: Overlay + - path: /network/drivers/host/ + title: Host + - path: /network/drivers/ipvlan/ + title: IPvlan + - path: /network/drivers/macvlan/ + title: Macvlan + - path: /network/drivers/none/ + title: None (no networking) + - path: /network/proxy/ + title: Configure Docker to use a proxy server + - path: /network/packet-filtering-firewalls/ + title: Packet filtering and firewalls + - path: /config/daemon/ipv6/ + title: Use IPv6 + - sectiontitle: Networking tutorials + section: + - path: /network/network-tutorial-standalone/ + title: Bridge network tutorial + - path: /network/network-tutorial-host/ + title: Host networking tutorial + - path: /network/network-tutorial-overlay/ + title: Overlay networking tutorial + - path: /network/network-tutorial-macvlan/ + title: Macvlan network tutorial + - sectiontitle: Legacy networking content + section: + - path: /network/links/ + title: (Legacy) Container links + - sectiontitle: Containers + section: + - path: /engine/reference/run/ + title: Running containers + - path: /config/containers/resource_constraints/ + title: Configure resource constraints + - path: /config/containers/multi-service_container/ + title: Run multiple processes in a container + - path: /config/containers/start-containers-automatically/ + title: Start containers automatically + - sectiontitle: CLI + section: + - path: /engine/reference/commandline/cli/ + title: Use the Docker CLI + - path: /config/completion/ + title: Completion + - path: /config/filter/ + title: Filter commands + - path: /config/formatting/ + title: Format command and log output + - path: /config/otel/ + title: OpenTelemetry + - sectiontitle: Manage resources + section: + - path: /config/pruning/ + title: Prune unused objects + - path: /config/labels-custom-metadata/ + title: Labels + - path: /engine/context/working-with-contexts/ + title: Contexts + - sectiontitle: Daemon + section: + - path: /config/daemon/start/ + title: Start the daemon + - path: /config/daemon/ + title: Configure the daemon + - path: /config/daemon/proxy/ + title: HTTP proxy + - path: /config/containers/live-restore/ + title: Live restore + - path: /config/daemon/troubleshoot/ + title: Troubleshoot + - path: /config/daemon/remote-access/ + title: Remote access + - path: /engine/alternative-runtimes/ + title: Alternative container runtimes + - sectiontitle: Engine plugins + section: + - path: /engine/extend/ + title: Managed plugin system + - path: /engine/extend/plugins_authorization/ + title: Access authorization plugin + - path: /engine/extend/legacy_plugins/ + title: Extending Docker with plugins + - path: /engine/extend/plugins_network/ + title: Network plugins + - path: /engine/extend/plugins_logging/ + title: Logging plugins + - path: /engine/extend/plugins_volume/ + title: Volume plugins + - title: Plugin configuration + path: /engine/extend/config/ + - path: /engine/extend/plugin_api/ + title: Plugin API + - sectiontitle: Logs and metrics + section: + - sectiontitle: Container logs + section: + - path: /config/containers/logging/ + title: View container logs + - path: /config/containers/logging/configure/ + title: Configure logging drivers + - path: /config/containers/logging/dual-logging/ + title: Use a remote logging driver + - path: /config/containers/logging/plugins/ + title: Use a logging driver plugin + - path: /config/containers/logging/log_tags/ + title: Customize log driver output + - sectiontitle: Logging drivers + section: + - path: /config/containers/logging/local/ + title: Local file logging driver + - path: /config/containers/logging/json-file/ + title: JSON File logging driver + - path: /config/containers/logging/gelf/ + title: Graylog Extended Format (GELF) logging driver + - path: /config/containers/logging/syslog/ + title: Syslog logging driver + - path: /config/containers/logging/awslogs/ + title: Amazon CloudWatch logs logging driver + - path: /config/containers/logging/etwlogs/ + title: ETW logging driver + - path: /config/containers/logging/fluentd/ + title: Fluentd logging driver + - path: /config/containers/logging/gcplogs/ + title: Google Cloud logging driver + - path: /config/containers/logging/journald/ + title: Journald logging driver + - path: /config/containers/logging/splunk/ + title: Splunk logging driver + - path: /config/daemon/logs/ + title: Daemon logs + - path: /config/containers/runmetrics/ + title: Runtime metrics + - path: /config/daemon/prometheus/ + title: Collect metrics with Prometheus + - sectiontitle: Security + section: + - path: /engine/security/ + title: Overview + - path: /engine/security/rootless/ + title: Rootless mode + - path: /engine/security/non-events/ + title: Docker security non-events + - path: /engine/security/protect-access/ + title: Protect the Docker daemon socket + - path: /engine/security/certificates/ + title: Using certificates for repository client verification + - sectiontitle: Use trusted images + section: + - path: /engine/security/trust/ + title: Overview + - path: /engine/security/trust/trust_automation/ + title: Automation + - path: /engine/security/trust/trust_delegation/ + title: Delegations + - path: /engine/security/trust/deploying_notary/ + title: Deploy Notary + - path: /engine/security/trust/trust_key_mng/ + title: Manage content trust keys + - path: /engine/security/trust/trust_sandbox/ + title: Play in a content trust sandbox + - path: /engine/security/antivirus/ + title: Antivirus software + - path: /engine/security/apparmor/ + title: AppArmor security profiles + - path: /engine/security/seccomp/ + title: Seccomp security profiles + - path: /engine/security/userns-remap/ + title: Isolate containers with a user namespace + - sectiontitle: Swarm mode + section: + - path: /engine/swarm/ + title: Swarm mode overview + - path: /engine/swarm/key-concepts/ + title: Swarm mode key concepts + - sectiontitle: Get started with swarm mode + section: + - path: /engine/swarm/swarm-tutorial/ + title: Swarm mode tutorial overview + - path: /engine/swarm/swarm-tutorial/create-swarm/ + title: Create a swarm + - path: /engine/swarm/swarm-tutorial/add-nodes/ + title: Add nodes to the swarm + - path: /engine/swarm/swarm-tutorial/deploy-service/ + title: Deploy a service + - path: /engine/swarm/swarm-tutorial/inspect-service/ + title: Inspect the service + - path: /engine/swarm/swarm-tutorial/scale-service/ + title: Scale the service + - path: /engine/swarm/swarm-tutorial/delete-service/ + title: Delete the service + - path: /engine/swarm/swarm-tutorial/rolling-update/ + title: Apply rolling updates + - path: /engine/swarm/swarm-tutorial/drain-node/ + title: Drain a node + - path: /engine/swarm/ingress/ + title: Use Swarm mode routing mesh + - sectiontitle: How Swarm mode works + section: + - path: /engine/swarm/how-swarm-mode-works/nodes/ + title: How nodes work + - path: /engine/swarm/how-swarm-mode-works/services/ + title: How services work + - path: /engine/swarm/how-swarm-mode-works/pki/ + title: Manage swarm security with PKI + - path: /engine/swarm/how-swarm-mode-works/swarm-task-states/ + title: Swarm task states + - path: /engine/swarm/swarm-mode/ + title: Run Docker in Swarm mode + - path: /engine/swarm/join-nodes/ + title: Join nodes to a swarm + - path: /engine/swarm/manage-nodes/ + title: Manage nodes in a swarm + - path: /engine/swarm/services/ + title: Deploy services to a swarm + - path: /engine/swarm/stack-deploy/ + title: Deploy a stack to a swarm + - path: /engine/swarm/configs/ + title: Store service configuration data + - path: /engine/swarm/secrets/ + title: Manage sensitive data with Docker secrets + - path: /engine/swarm/swarm_manager_locking/ + title: Lock your swarm + - path: /engine/swarm/networking/ + title: Manage swarm service networks + - path: /engine/swarm/admin_guide/ + title: Swarm administration guide + - path: /engine/swarm/raft/ + title: Raft consensus in Swarm mode + - path: /engine/deprecated/ + title: Deprecated features + - sectiontitle: Release notes + section: + - path: /engine/release-notes/27.0/ + title: Engine 27.0 + - sectiontitle: Previous versions + section: + - path: /engine/release-notes/26.1/ + title: Engine 26.1 + - path: /engine/release-notes/26.0/ + title: Engine 26.0 + - path: /engine/release-notes/25.0/ + title: Engine 25.0 + - path: /engine/release-notes/24.0/ + title: Engine 24.0 + - path: /engine/release-notes/23.0/ + title: Engine 23.0 + - path: /engine/release-notes/20.10/ + title: Engine 20.10 + - path: /engine/release-notes/19.03/ + title: Engine 19.03 + - path: /engine/release-notes/18.09/ + title: Engine 18.09 + - path: /engine/release-notes/18.06/ + title: Engine 18.06 + - path: /engine/release-notes/18.05/ + title: Engine 18.05 + - path: /engine/release-notes/18.04/ + title: Engine 18.04 + - path: /engine/release-notes/18.03/ + title: Engine 18.03 + - path: /engine/release-notes/18.02/ + title: Engine 18.02 + - path: /engine/release-notes/18.01/ + title: Engine 18.01 + - path: /engine/release-notes/17.12/ + title: Engine 17.12 + - path: /engine/release-notes/17.11/ + title: Engine 17.11 + - path: /engine/release-notes/17.10/ + title: Engine 17.10 + - path: /engine/release-notes/17.09/ + title: Engine 17.09 + - path: /engine/release-notes/17.07/ + title: Engine 17.07 + - path: /engine/release-notes/17.06/ + title: Engine 17.06 + - path: /engine/release-notes/17.05/ + title: Engine 17.05 + - path: /engine/release-notes/17.04/ + title: Engine 17.04 + - path: /engine/release-notes/17.03/ + title: Engine 17.03 + - path: /engine/release-notes/prior-releases/ + title: Engine 1.13 and earlier +- sectiontitle: Docker Build + section: + - path: /build/ + title: Overview + - path: /build/architecture/ + title: Architecture + - sectiontitle: Building images + section: + - path: /build/building/packaging/ + title: Packaging your software + - path: /build/building/context/ + title: Context + - path: /build/building/multi-stage/ + title: Multi-stage builds + - path: /build/building/variables/ + title: Variables + - path: /build/building/best-practices/ + title: Best practices + - path: /build/building/multi-platform/ + title: Multi-platform images + - path: /build/building/secrets/ + title: Build secrets + - path: /build/building/annotations/ + title: Annotations + - path: /build/building/opentelemetry/ + title: OpenTelemetry support + - path: /build/building/base-images/ + title: Base images + - path: /build/checks/ + title: Build checks {{< badge color=violet text=New >}} + - sectiontitle: Builders + section: + - path: /build/builders/ + title: Builders overview + - path: /build/builders/manage/ + title: Manage builders + - sectiontitle: Drivers + section: + - path: /build/drivers/ + title: Drivers overview + - path: /build/drivers/docker/ + title: Docker driver + - path: /build/drivers/docker-container/ + title: Docker container driver + - path: /build/drivers/kubernetes/ + title: Kubernetes driver + - path: /build/drivers/remote/ + title: Remote driver + - sectiontitle: Exporters + section: + - path: /build/exporters/ + title: Overview + - path: /build/exporters/image-registry/ + title: Image and registry exporters + - path: /build/exporters/local-tar/ + title: Local and tar exporters + - path: /build/exporters/oci-docker/ + title: OCI and Docker exporters + - sectiontitle: Cache + section: + - path: /build/cache/ + title: Overview + - path: /build/cache/invalidation/ + title: Cache invalidation + - path: /build/cache/garbage-collection/ + title: Garbage collection + - sectiontitle: Cache backends + section: + - path: /build/cache/backends/ + title: Overview + - path: /build/cache/backends/inline/ + title: Inline + - path: /build/cache/backends/local/ + title: Local + - path: /build/cache/backends/registry/ + title: Registry + - path: /build/cache/backends/gha/ + title: GitHub Actions + - path: /build/cache/backends/azblob/ + title: Azure Blob Storage + - path: /build/cache/backends/s3/ + title: Amazon S3 + - sectiontitle: Bake + section: + - path: /build/bake/ + title: Overview + - path: /build/bake/introduction/ + title: Introduction + - path: /build/bake/targets/ + title: Targets + - path: /build/bake/inheritance/ + title: Inheritance + - path: /build/bake/variables/ + title: Variables + - path: /build/bake/expressions/ + title: Expressions + - path: /build/bake/funcs/ + title: Functions + - path: /build/bake/matrices/ + title: Matrices + - path: /build/bake/contexts/ + title: Contexts + - path: /build/bake/overrides/ + title: Overriding configuration + - path: /build/bake/reference/ + title: Bake file reference + - path: /build/bake/compose-file/ + title: Building from Compose file + - path: /build/bake/remote-definition/ + title: Remote Bake file definition + - sectiontitle: Attestations + section: + - path: /build/attestations/ + title: Overview + - path: /build/attestations/sbom/ + title: SBOM + - path: /build/attestations/slsa-provenance/ + title: Provenance + - path: /build/attestations/slsa-definitions/ + title: SLSA definitions + - path: /build/attestations/attestation-storage/ + title: Attestation storage + - sectiontitle: Dockerfile + section: + - path: /build/dockerfile/frontend/ + title: Custom Dockerfile syntax + - path: /build/dockerfile/release-notes/ + title: Release notes + - sectiontitle: BuildKit + section: + - path: /build/buildkit/ + title: Overview + - path: /build/buildkit/configure/ + title: Configure + - path: /build/buildkit/toml-configuration/ + title: TOML configuration + - sectiontitle: Continuous integration + section: + - path: /build/ci/ + title: CI with Docker + - sectiontitle: GitHub Actions + section: + - path: /build/ci/github-actions/ + title: Introduction + - path: /build/ci/github-actions/build-summary/ + title: Build summary {{< badge color=blue text=Beta >}} + - path: /build/ci/github-actions/configure-builder/ + title: Configuring your builder + - path: /build/ci/github-actions/multi-platform/ + title: Multi-platform image + - path: /build/ci/github-actions/secrets/ + title: Secrets + - path: /build/ci/github-actions/push-multi-registries/ + title: Push to multiple registries + - path: /build/ci/github-actions/manage-tags-labels/ + title: Manage tags and labels + - path: /build/ci/github-actions/cache/ + title: Cache management + - path: /build/ci/github-actions/export-docker/ + title: Export to Docker + - path: /build/ci/github-actions/test-before-push/ + title: Test before push + - path: /build/ci/github-actions/local-registry/ + title: Local registry + - path: /build/ci/github-actions/share-image-jobs/ + title: Share built image between jobs + - path: /build/ci/github-actions/named-contexts/ + title: Named contexts + - path: /build/ci/github-actions/copy-image-registries/ + title: Copy image between registries + - path: /build/ci/github-actions/update-dockerhub-desc/ + title: Update Docker Hub repo description + - path: /build/ci/github-actions/attestations/ + title: SBOM and provenance attestations + - path: /build/ci/github-actions/annotations/ + title: Annotations + - path: /build/ci/github-actions/reproducible-builds/ + title: Reproducible builds + - path: /build/release-notes/ + title: Release notes +- sectiontitle: Docker Build Cloud + section: + - path: /build-cloud/ + title: Overview + - path: /build-cloud/setup/ + title: Setup + - path: /build-cloud/usage/ + title: Usage + - path: /build-cloud/ci/ + title: Continuous integration + - path: /build-cloud/optimization/ + title: Optimization +- sectiontitle: Docker Compose + section: + - path: /compose/ + title: Overview + - sectiontitle: Introduction to Compose + section: + - path: /compose/intro/features-uses/ + title: Why use Compose? + - path: /compose/intro/history/ + title: History and development of Compose + - sectiontitle: Install + section: + - path: /compose/install/ + title: Overview + - path: /compose/install/linux/ + title: Install Compose plugin + - path: /compose/install/standalone/ + title: Install Compose standalone + - path: /compose/install/uninstall/ + title: Uninstall Compose + - path: /compose/compose-application-model/ + title: How Compose works + - path: /compose/gettingstarted/ + title: Quickstart + - path: /compose/project-name/ + title: Specify a project name + - sectiontitle: Environment variables + section: + - path: /compose/environment-variables/ + title: Overview + - path: /compose/environment-variables/set-environment-variables/ + title: Explore ways to set environment variables + - path: /compose/environment-variables/envvars-precedence/ + title: Understand environment variables precedence + - path: /compose/environment-variables/envvars/ + title: Set or change pre-defined environment variables + - path: /compose/environment-variables/variable-interpolation/ + title: Interpolation + - path: /compose/environment-variables/best-practices/ + title: Best practices + - sectiontitle: Use... + section: + - path: /compose/profiles/ + title: ...service profiles + - path: /compose/file-watch/ + title: ...Compose Watch + - path: /compose/production/ + title: ...Compose in production + - path: /compose/use-secrets/ + title: ...secrets in Compose + - sectiontitle: Working with multiple Compose files + section: + - path: /compose/multiple-compose-files/ + title: Overview + - path: /compose/multiple-compose-files/merge/ + title: Merge + - path: /compose/multiple-compose-files/extends/ + title: Extend + - path: /compose/multiple-compose-files/include/ + title: Include + - path: /compose/startup-order/ + title: Control startup order + - path: /compose/gpu-support/ + title: GPU support + - path: /compose/networking/ + title: Networking + - path: /compose/samples-for-compose/ + title: Sample apps + - path: /compose/feedback/ + title: Give feedback + - path: /compose/migrate/ + title: Migrate to Compose V2 + - path: /compose/faq/ + title: Compose FAQ + - path: /compose/release-notes/ + title: Release notes + +- sectiontitle: Docker Hub + section: + - path: /docker-hub/ + title: Overview + - path: /docker-id/ + title: Create an account + - path: /docker-hub/quickstart/ + title: Quickstart + - sectiontitle: Repositories + section: + - path: /docker-hub/repos/create/ + title: Create + - path: /docker-hub/repos/access/ + title: Access + - path: /docker-hub/repos/ + title: Manage + - path: /docker-hub/repos/categories/ + title: Categories + - path: /docker-hub/download-rate-limit/ + title: Download rate limit + - path: /docker-hub/webhooks/ + title: Webhooks + - path: /docker-hub/service-accounts/ + title: Service accounts + - sectiontitle: Automated builds + section: + - path: /docker-hub/builds/how-builds-work/ + title: How Automated builds work + - path: /docker-hub/builds/ + title: Set up Automated builds + - path: /docker-hub/builds/manage-builds/ + title: Manage your builds + - path: /docker-hub/builds/troubleshoot/ + title: Troubleshoot your builds + - path: /docker-hub/builds/automated-testing/ + title: Testing in Automated builds + - path: /docker-hub/builds/advanced/ + title: Advanced options for builds + - path: /docker-hub/builds/link-source/ + title: Link to GitHub and BitBucket + - path: /docker-hub/vulnerability-scanning/ + title: Vulnerability scanning + - path: /docker-hub/mirror/ + title: Mirroring + - path: /registry/ + title: Registry + - path: /docker-hub/oci-artifacts/ + title: OCI artifacts + - path: /docker-hub/release-notes/ + title: Release notes + +- title: Docker for GitHub Copilot {{< badge color=violet text="Early Access" >}} + path: /copilot/ + +- sectiontitle: Administration + section: + - path: /admin/ + title: Overview + - sectiontitle: Organization administration + section: + - path: /admin/organization/ + title: Overview + - path: /admin/organization/orgs/ + title: Create your organization + - path: /admin/organization/onboard/ + title: Onboard your organization + - path: /admin/organization/members/ + title: Manage members + - path: /admin/organization/manage-a-team/ + title: Create and manage a team + - path: /admin/organization/activity-logs/ + title: Activity logs + - path: /admin/organization/general-settings/ + title: Organization settings + - sectiontitle: Company administration + section: + - path: /admin/company/ + title: Overview + - path: /admin/company/new-company/ + title: Create a company + - path: /admin/company/organizations/ + title: Manage organizations + - path: /admin/company/users/ + title: Manage users + - path: /admin/company/owners/ + title: Manage company owners + - sectiontitle: Account and admin FAQ + section: + - path: /admin/faqs/general-faqs/ + title: General + - path: /admin/faqs/organization-faqs/ + title: Organization + - path: /admin/faqs/company-faqs/ + title: Company + - path: /admin/convert-account/ + title: Convert an account into an organization + - path: /admin/deactivate-account/ + title: Deactivate an account or organization + +- sectiontitle: Security + section: + - path: /security/ + title: Overview + - sectiontitle: For admins + section: + - sectiontitle: Single Sign-on + section: + - path: /security/for-admins/single-sign-on/ + title: Overview + - path: /security/for-admins/single-sign-on/configure/ + title: Configure Docker + - path: /security/for-admins/single-sign-on/configure/configure-idp/ + title: Configure your IdP + - path: /security/for-admins/single-sign-on/connect/ + title: Connect + - path: /security/for-admins/single-sign-on/manage/ + title: Manage + - sectiontitle: Provisioning + section: + - path: /security/for-admins/provisioning/scim/ + title: SCIM + - path: /security/for-admins/provisioning/just-in-time/ + title: Just-in-Time + - path: /security/for-admins/provisioning/group-mapping/ + title: Group mapping + - path: /security/for-admins/configure-sign-in/ + title: Enforce sign in + - path: /security/for-admins/roles-and-permissions/ + title: Roles and permissions + - path: /security/for-admins/domain-audit/ + title: Domain audit + - path: /security/for-admins/image-access-management/ + title: Image Access Management + - path: /security/for-admins/registry-access-management/ + title: Registry Access Management + - sectiontitle: For developers + section: + - path: /security/for-developers/access-tokens/ + title: Create and manage access tokens + - sectiontitle: Two-factor authentication + section: + - path: /security/for-developers/2fa/ + title: Enable two-factor authentication + - path: /security/for-developers/2fa/disable-2fa/ + title: Disable two-factor authentication + - path: /security/for-developers/2fa/recover-hub-account/ + title: Recover your Docker Hub account + - path: /security/for-developers/2fa/new-recovery-code/ + title: Generate a new recovery code + - path: /security/security-announcements/ + title: Security announcements + - sectiontitle: Security FAQs + section: + - path: /security/faqs/general/ + title: General + - path: /security/faqs/networking-and-vms/ + title: Networking and VMs + - path: /security/faqs/containers/ + title: Containers + - sectiontitle: Single Sign-On + section: + - path: /security/faqs/single-sign-on/faqs/ + title: General + - path: /security/faqs/single-sign-on/idp-faqs/ + title: Identity providers + - path: /security/faqs/single-sign-on/domain-faqs/ + title: Domains + - path: /security/faqs/single-sign-on/enforcement-faqs/ + title: Enforcement + - path: /security/faqs/single-sign-on/users-faqs/ + title: Manage users + +- sectiontitle: Billing + section: + - path: /billing/ + title: Overview + - sectiontitle: Docker Core billing + section: + - path: /billing/core-billing/get-started-core/ + title: Get started with Docker Core + - path: /billing/core-billing/payment-method/ + title: Add or update a payment method + - path: /billing/core-billing/details/ + title: Update the billing information + - path: /billing/core-billing/history/ + title: View your billing history + - path: /billing/core-billing/cycle/ + title: Change your billing cycle + - path: /billing/build-billing/ + title: Docker Build Cloud billing + - path: /billing/scout-billing/ + title: Docker Scout billing + - path: /billing/tax-certificate/ + title: Register a tax certificate + - path: /billing/3d-secure/ + title: 3D Secure authentication + - path: /billing/faqs/ + title: Billing FAQs + +- sectiontitle: Subscription + section: + - path: /subscription/ + title: Overview + - sectiontitle: Docker Core + section: + - path: /subscription/core-subscription/details/ + title: Subscriptions and features + - path: /subscription/core-subscription/upgrade/ + title: Upgrade + - path: /subscription/core-subscription/add-seats/ + title: Add seats + - path: /subscription/core-subscription/remove-seats/ + title: Remove seats + - path: /subscription/core-subscription/downgrade/ + title: Downgrade + - sectiontitle: Docker Build Cloud + section: + - path: /subscription/build-cloud/build-details/ + title: Subscriptions and features + - path: /subscription/build-cloud/manage-seats/ + title: Manage seats and invites + - path: /subscription/scout-details/ + title: Docker Scout subscriptions and features + - path: /subscription/desktop-license/ + title: Docker Desktop license agreement + - path: /subscription/faq/ + title: Subscription FAQ + +- sectiontitle: Trusted content + section: + - path: /trusted-content/ + title: Overview + - sectiontitle: Docker Official Images + section: + - path: /trusted-content/official-images/ + title: Overview + - path: /trusted-content/official-images/using/ + title: Using official images + - path: /trusted-content/official-images/contributing/ + title: Contributing + - path: /trusted-content/dvp-program/ + title: Docker Verified Publisher Program + - path: /trusted-content/dsos-program/ + title: Docker-Sponsored Open Source Program + - path: /trusted-content/insights-analytics/ + title: Insights and analytics + +- path: /support/ + title: Get support +- path: /release-lifecycle/ + title: Product release lifecycle From f91b0fd6b9eff1f817af3013d4803c86c29592de Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Thu, 11 Jul 2024 15:53:08 -0600 Subject: [PATCH 02/13] Add deploy file --- content/language/ruby/deploy.md | 58 ++++++++++++++------------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/content/language/ruby/deploy.md b/content/language/ruby/deploy.md index 370dd0a4528..51777e036ee 100644 --- a/content/language/ruby/deploy.md +++ b/content/language/ruby/deploy.md @@ -6,7 +6,7 @@ description: Learn how to develop locally using Kubernetes ## Prerequisites -- Complete all the previous sections of this guide, starting with [Containerize a Python application](containerize.md). +- Complete all the previous sections of this guide, starting with [Containerize a Ruby on Rails application](containerize.md). - [Turn on Kubernetes](/desktop/kubernetes/#install-and-turn-on-kubernetes) in Docker Desktop. ## Overview @@ -15,48 +15,45 @@ In this section, you'll learn how to use Docker Desktop to deploy your applicati ## Create a Kubernetes YAML file -In your `python-docker-dev` directory, create a file named -`docker-python-kubernetes.yaml`. Open the file in an IDE or text editor and add +In your `docker-ruby-on-rails` directory, create a file named +`docker-ruby-on-rails-kubernetes.yaml`. Open the file in an IDE or text editor and add the following contents. Replace `DOCKER_USERNAME/REPO_NAME` with your Docker username and the name of the repository that you created in [Configure CI/CD for -your Python application](configure-ci-cd.md). +your Ruby on Rails application](configure-ci-cd.md). ```yaml apiVersion: apps/v1 kind: Deployment metadata: - name: docker-python-demo + name: docker-ruby-on-rails-demo namespace: default spec: replicas: 1 selector: matchLabels: - service: flask + service: ruby-on-rails template: metadata: labels: - service: flask + service: ruby-on-rails spec: containers: - - name: flask-service + - name: ruby-on-rails-container image: DOCKER_USERNAME/REPO_NAME imagePullPolicy: Always - env: - - name: POSTGRES_PASSWORD - value: mysecretpassword --- apiVersion: v1 kind: Service metadata: - name: service-entrypoint + name: docker-ruby-on-rails-demo namespace: default spec: type: NodePort selector: - service: flask + service: ruby-on-rails ports: - - port: 8001 - targetPort: 8001 + - port: 3000 + targetPort: 3000 nodePort: 30001 ``` @@ -75,18 +72,18 @@ To learn more about Kubernetes objects, see the [Kubernetes documentation](https ## Deploy and check your application -1. In a terminal, navigate to `python-docker-dev` and deploy your application to +1. In a terminal, navigate to `docker-ruby-on-rails` and deploy your application to Kubernetes. ```console - $ kubectl apply -f docker-python-kubernetes.yaml + $ kubectl apply -f docker-ruby-on-rails-kubernetes.yaml ``` You should see output that looks like the following, indicating your Kubernetes objects were created successfully. ```shell - deployment.apps/docker-python-demo created - service/service-entrypoint created + deployment.apps/docker-ruby-on-rails-demo created + service/docker-ruby-on-rails-demo ``` 2. Make sure everything worked by listing your deployments. @@ -98,8 +95,8 @@ To learn more about Kubernetes objects, see the [Kubernetes documentation](https Your deployment should be listed as follows: ```shell - NAME READY UP-TO-DATE AVAILABLE AGE - docker-python-demo 1/1 1 1 15s + NAME READY UP-TO-DATE AVAILABLE AGE + docker-ruby-on-rails-demo 1/1 1 1 15s ``` This indicates all one of the pods you asked for in your YAML are up and running. Do the same check for your services. @@ -111,25 +108,20 @@ To learn more about Kubernetes objects, see the [Kubernetes documentation](https You should get output like the following. ```shell - NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE - kubernetes ClusterIP 10.96.0.1 443/TCP 23h - service-entrypoint NodePort 10.99.128.230 8001:30001/TCP 75s + NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + kubernetes ClusterIP 10.96.0.1 443/TCP 23h + docker-ruby-on-rails-demo NodePort 10.99.128.230 8001:30001/TCP 75s ``` - In addition to the default `kubernetes` service, you can see your `service-entrypoint` service, accepting traffic on port 30001/TCP. + In addition to the default `kubernetes` service, you can see your `docker-ruby-on-rails-demo` service, accepting traffic on port 30001/TCP. -3. In a terminal, curl the service. Note that a database was not deployed in - this example. - - ```console - $ curl http://localhost:30001/ - Hello, Docker!!! - ``` +3. IOpen the browser and go to http://localhost:30001/, you should see the ruby on rails application working. + Note that a database was not deployed in this example. 4. Run the following command to tear down your application. ```console - $ kubectl delete -f docker-python-kubernetes.yaml + $ kubectl delete -f docker-ruby-on-rails-kubernetes.yaml ``` ## Summary From e33a5679681d076d323ee5d56ebd22200bf1eb00 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Mon, 15 Jul 2024 10:21:15 -0600 Subject: [PATCH 03/13] Update deploy --- content/language/ruby/deploy.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/content/language/ruby/deploy.md b/content/language/ruby/deploy.md index 51777e036ee..93c9a7295d5 100644 --- a/content/language/ruby/deploy.md +++ b/content/language/ruby/deploy.md @@ -63,7 +63,7 @@ In this Kubernetes YAML file, there are two objects, separated by the `---`: you'll get just one replica, or copy of your pod. That pod, which is described under `template`, has just one container in it. The container is created from the image built by GitHub Actions in [Configure CI/CD for - your Python application](configure-ci-cd.md). + your Ruby on Rails application](configure-ci-cd.md). - A NodePort service, which will route traffic from port 30001 on your host to port 8001 inside the pods it routes to, allowing you to reach your app from the network. @@ -83,7 +83,7 @@ To learn more about Kubernetes objects, see the [Kubernetes documentation](https ```shell deployment.apps/docker-ruby-on-rails-demo created - service/docker-ruby-on-rails-demo + service/docker-ruby-on-rails-demo created ``` 2. Make sure everything worked by listing your deployments. @@ -114,8 +114,13 @@ To learn more about Kubernetes objects, see the [Kubernetes documentation](https ``` In addition to the default `kubernetes` service, you can see your `docker-ruby-on-rails-demo` service, accepting traffic on port 30001/TCP. + Create and migrate the database + ``` + kubectl exec -it -- rails db:migrate RAILS_ENV=development + + ``` -3. IOpen the browser and go to http://localhost:30001/, you should see the ruby on rails application working. +3. Open the browser and go to http://localhost:30001/, you should see the ruby on rails application working. Note that a database was not deployed in this example. 4. Run the following command to tear down your application. From b2ec26150e0b2ef4fd55defa381461b4c13feebb Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Mon, 15 Jul 2024 10:27:00 -0600 Subject: [PATCH 04/13] Update database --- content/language/ruby/containerize.md | 244 +++++++++++++++++++++---- content/language/ruby/develop.md | 248 ++++++++++++++++++++++---- 2 files changed, 418 insertions(+), 74 deletions(-) diff --git a/content/language/ruby/containerize.md b/content/language/ruby/containerize.md index 3f17d73a788..9c99e34d9bd 100644 --- a/content/language/ruby/containerize.md +++ b/content/language/ruby/containerize.md @@ -107,57 +107,229 @@ services: Create a file named `.dockerignore` with the following contents. ```text {collapse=true,title=".dockerignore"} -# Include any files or directories that you don't want to be copied to your -# container here (e.g., local build artifacts, temporary files, etc.). -# -# For more help, visit the .dockerignore file reference guide at -# https://docs.docker.com/go/build-context-dockerignore/ +git +.gitignore -# Ignore bundler config -/.bundle +# Created by https://www.gitignore.io/api/git,ruby,rails,jetbrains+all +# Edit at https://www.gitignore.io/?templates=git,ruby,rails,jetbrains+all + +### Git ### +# Created by git for backups. To disable backups in Git: +# $ git config --global mergetool.keepBackup false +*.orig + +# Created by git when using merge tools for conflicts +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +*_BACKUP_*.txt +*_BASE_*.txt +*_LOCAL_*.txt +*_REMOTE_*.txt + +### JetBrains+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### JetBrains+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Rails ### +*.rbc +capybara-*.html +.rspec +/db/*.sqlite3 +/db/*.sqlite3-journal +/public/system +/coverage/ +/spec/tmp +rerun.txt +pickle-email-*.html -# Ignore all log files and tempfiles +# Ignore all logfiles and tempfiles. /log/* /tmp/* !/log/.keep !/tmp/.keep -# Ignore the development and test databases -/db/*.sqlite3 -/db/*.sqlite3-journal +# TODO Comment out this rule if you are OK with secrets being uploaded to the repo +config/initializers/secret_token.rb +config/master.key -# Ignore the production secrets file -/config/secrets.yml +# Only include if you have production secrets in this file, which is no longer a Rails default +# config/secrets.yml -# Ignore all files in the test, spec, and features folders -/test/* -/spec/* -/features/* +# dotenv +# TODO Comment out this rule if environment variables can be committed +.env -# Ignore system-specific files -*.swp -*.swo -*~ -*.DS_Store +## Environment normalization: +/.bundle +/vendor/bundle + +# these should all be checked in to normalize the environment: +# Gemfile.lock, .ruby-version, .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# if using bower-rails ignore default bower_components path bower.json files +/vendor/assets/bower_components +*.bowerrc +bower.json + +# Ignore pow environment settings +.powenv + +# Ignore Byebug command history file. +.byebug_history + +# Ignore node_modules +node_modules/ + +# Ignore precompiled javascript packs +/public/packs +/public/packs-test +/public/assets + +# Ignore yarn files +/yarn-error.log +yarn-debug.log* +.yarn-integrity + +# Ignore uploaded files in development +/storage/* +!/storage/.keep + +### Ruby ### +*.gem +/.config +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +# Ignore Byebug command history file. + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# vendor/Pods/ -# Ignore coverage reports -/coverage/* +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ -# Ignore node modules (if using a JavaScript front-end with Ruby on Rails) -/node_modules +/.bundle/ +/lib/bundler/man/ -# Ignore yarn lock file -/yarn.lock +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset -# Ignore the .git directory and other VCS files -.git -.gitignore +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -**/docker-compose* -**/compose.y*ml -**/Dockerfile* -LICENSE -README.md +# End of https://www.gitignore.io/api/git,ruby,rails,jetbrains+all ``` You should now have the following three files in your `docker-ruby-on-rails` diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md index 2711f7e214c..fa8b3370534 100644 --- a/content/language/ruby/develop.md +++ b/content/language/ruby/develop.md @@ -101,57 +101,229 @@ version: '3' Create a file named `.dockerignore` with the following contents. ```text {collapse=true,title=".dockerignore"} -# Include any files or directories that you don't want to be copied to your -# container here (e.g., local build artifacts, temporary files, etc.). -# -# For more help, visit the .dockerignore file reference guide at -# https://docs.docker.com/go/build-context-dockerignore/ +git +.gitignore -# Ignore bundler config -/.bundle +# Created by https://www.gitignore.io/api/git,ruby,rails,jetbrains+all +# Edit at https://www.gitignore.io/?templates=git,ruby,rails,jetbrains+all + +### Git ### +# Created by git for backups. To disable backups in Git: +# $ git config --global mergetool.keepBackup false +*.orig + +# Created by git when using merge tools for conflicts +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +*_BACKUP_*.txt +*_BASE_*.txt +*_LOCAL_*.txt +*_REMOTE_*.txt + +### JetBrains+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### JetBrains+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Rails ### +*.rbc +capybara-*.html +.rspec +/db/*.sqlite3 +/db/*.sqlite3-journal +/public/system +/coverage/ +/spec/tmp +rerun.txt +pickle-email-*.html -# Ignore all log files and tempfiles +# Ignore all logfiles and tempfiles. /log/* /tmp/* !/log/.keep !/tmp/.keep -# Ignore the development and test databases -/db/*.sqlite3 -/db/*.sqlite3-journal +# TODO Comment out this rule if you are OK with secrets being uploaded to the repo +config/initializers/secret_token.rb +config/master.key -# Ignore the production secrets file -/config/secrets.yml +# Only include if you have production secrets in this file, which is no longer a Rails default +# config/secrets.yml -# Ignore all files in the test, spec, and features folders -/test/* -/spec/* -/features/* +# dotenv +# TODO Comment out this rule if environment variables can be committed +.env -# Ignore system-specific files -*.swp -*.swo -*~ -*.DS_Store +## Environment normalization: +/.bundle +/vendor/bundle + +# these should all be checked in to normalize the environment: +# Gemfile.lock, .ruby-version, .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# if using bower-rails ignore default bower_components path bower.json files +/vendor/assets/bower_components +*.bowerrc +bower.json + +# Ignore pow environment settings +.powenv + +# Ignore Byebug command history file. +.byebug_history + +# Ignore node_modules +node_modules/ + +# Ignore precompiled javascript packs +/public/packs +/public/packs-test +/public/assets + +# Ignore yarn files +/yarn-error.log +yarn-debug.log* +.yarn-integrity + +# Ignore uploaded files in development +/storage/* +!/storage/.keep + +### Ruby ### +*.gem +/.config +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +# Ignore Byebug command history file. + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# vendor/Pods/ -# Ignore coverage reports -/coverage/* +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ -# Ignore node modules (if using a JavaScript front-end with Ruby on Rails) -/node_modules +/.bundle/ +/lib/bundler/man/ -# Ignore yarn lock file -/yarn.lock +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset -# Ignore the .git directory and other VCS files -.git -.gitignore +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -**/docker-compose* -**/compose.y*ml -**/Dockerfile* -LICENSE -README.md +# End of https://www.gitignore.io/api/git,ruby,rails,jetbrains+all ``` ## Add a local database and persist data @@ -178,7 +350,7 @@ services: - db-password environment: - POSTGRES_PASSWORD_FILE=/run/secrets/db-password - - RAILS_ENV=development + - RAILS_ENV=test db: image: postgres:latest secrets: @@ -273,7 +445,7 @@ services: - db-password environment: - POSTGRES_PASSWORD_FILE=/run/secrets/db-password - - RAILS_ENV=development + - RAILS_ENV=test develop: watch: - action: rebuild From 04eadd267d4543e785eafa71015f24f3ec2e6587 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Wed, 17 Jul 2024 10:54:44 -0600 Subject: [PATCH 05/13] Update files from codereview --- content/language/ruby/_index.md | 2 +- content/language/ruby/containerize.md | 11 +- content/language/ruby/develop.md | 361 ++------------------------ 3 files changed, 30 insertions(+), 344 deletions(-) diff --git a/content/language/ruby/_index.md b/content/language/ruby/_index.md index b43ea5905e6..2da18bcabb1 100644 --- a/content/language/ruby/_index.md +++ b/content/language/ruby/_index.md @@ -6,7 +6,7 @@ toc_min: 1 toc_max: 2 --- -The Ruby on Rails language-specific guide teaches you how to containerize a Ruby on Rails application using Docker. In this guide, you’ll learn how to: +The Ruby language-specific guide teaches you how to containerize a Ruby on Rails application using Docker. In this guide, you’ll learn how to: * Containerize and run a Ruby on Rails application * Set up a local environment to develop a Ruby on Rails application using containers diff --git a/content/language/ruby/containerize.md b/content/language/ruby/containerize.md index 9c99e34d9bd..9b3bd270db1 100644 --- a/content/language/ruby/containerize.md +++ b/content/language/ruby/containerize.md @@ -10,7 +10,7 @@ aliases: ## Prerequisites * You have installed the latest version of [Docker Desktop](../../get-docker.md). -* You have a [git client](https://git-scm.com/downloads). The examples in this section use a command-line based git client, but you can use any client. +* You have a [Git client](https://git-scm.com/downloads). The examples in this section show the Git CLI, but you can use any client. ## Overview @@ -32,11 +32,9 @@ Now that you have an application, you can create the necessary Docker assets to containerize your application. You can use Docker Desktop's built-in Docker Init feature to help streamline the process, or you can manually create the assets. -Docker's docker init command provides predefined configurations tailored for specific programming languages. This feature simplifies the setup process by automatically generating Dockerfiles and other necessary configuration files based on the chosen language. For example, docker init has predefined configurations for languages like Python, Java, and Node.js, making it easier to get started with Docker for these environments. +`docker init`, the command for bootstrapping the Docker-related assets for a project, does not yet support the Ruby programming language. This means that if you are working with Ruby, you'll need to create Dockerfiles and other related configurations manually. -However, it's important to note that as of now, docker init does not offer a predefined configuration for the Ruby programming language. This means that if you are working with Ruby, you'll need to create Dockerfiles and other related configurations manually. - -Inside the `docker-ruby-on-rails` directory, you should create the following files: +Inside the `docker-ruby-on-rails` directory, create the following files: Create a file named `Dockerfile` with the following contents. @@ -93,7 +91,6 @@ CMD ["rails", "server", "-b", "0.0.0.0"] Create a file named `compose.yaml` with the following contents. ```yaml {collapse=true,title=compose.yaml} -version: '3' services: web: build: . @@ -355,7 +352,7 @@ terminal. $ docker compose up --build ``` -Open a browser and view the application at [http://localhost:8000](http://localhost:8000). You should see a simple Ruby on Rails application. +Open a browser and view the application at [http://localhost:3000](http://localhost:3000). You should see a simple Ruby on Rails application. In the terminal, press `ctrl`+`c` to stop the application. diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md index fa8b3370534..3ecc832b351 100644 --- a/content/language/ruby/develop.md +++ b/content/language/ruby/develop.md @@ -15,317 +15,6 @@ In this section, you'll learn how to set up a development environment for your c - Adding a local database and persisting data - Configuring Compose to automatically update your running Compose services as you edit and save your code -## Get the sample application - -You'll need to clone a new repository to get a sample application that includes logic to connect to the database. - -1. Change to a directory where you want to clone the repository and run the following command. - - ```console - $ git clone https://github.com/falconcr/docker-ruby-on-rails.git - ``` - -2. In the cloned repository's directory, manually create the following files in your project directory. - - Create a file named `Dockerfile` with the following contents. - - ```dockerfile {collapse=true,title=Dockerfile} - # syntax=docker/dockerfile:1 - - # Use the official Ruby image with version 3.2.0 - FROM ruby:3.2.0 - - # Install dependencies - RUN apt-get update -qq && apt-get install -y \ - nodejs \ - postgresql-client \ - libssl-dev \ - libreadline-dev \ - zlib1g-dev \ - build-essential \ - curl - - # Install rbenv - RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv && \ - echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && \ - echo 'eval "$(rbenv init -)"' >> ~/.bashrc && \ - git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build && \ - echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc - - # Install the specified Ruby version using rbenv - ENV PATH="/root/.rbenv/bin:/root/.rbenv/shims:$PATH" - RUN rbenv install 3.2.0 && rbenv global 3.2.0 - - # Set the working directory - WORKDIR /myapp - - # Copy the Gemfile and Gemfile.lock - COPY Gemfile /myapp/Gemfile - COPY Gemfile.lock /myapp/Gemfile.lock - - # Install Gems dependencies - RUN gem install bundler && bundle install - - # Copy the application code - COPY . /myapp - - # Precompile assets (optional, if using Rails with assets) - RUN bundle exec rake assets:precompile - - # Expose the port the app runs on - EXPOSE 3000 - - # Command to run the server - CMD ["rails", "server", "-b", "0.0.0.0"] - - - -Create a file named `compose.yaml` with the following contents. - -```yaml {collapse=true,title=compose.yaml} -# Comments are provided throughout this file to help you get started. -# If you need more help, visit the Docker Compose reference guide at -# https://docs.docker.com/go/compose-spec-reference/ -version: '3' - services: - web: - build: . - command: bundle exec rails s -b '0.0.0.0' - volumes: - - .:/myapp - ports: - - "3000:3000" -``` - - -Create a file named `.dockerignore` with the following contents. - -```text {collapse=true,title=".dockerignore"} -git -.gitignore - -# Created by https://www.gitignore.io/api/git,ruby,rails,jetbrains+all -# Edit at https://www.gitignore.io/?templates=git,ruby,rails,jetbrains+all - -### Git ### -# Created by git for backups. To disable backups in Git: -# $ git config --global mergetool.keepBackup false -*.orig - -# Created by git when using merge tools for conflicts -*.BACKUP.* -*.BASE.* -*.LOCAL.* -*.REMOTE.* -*_BACKUP_*.txt -*_BASE_*.txt -*_LOCAL_*.txt -*_REMOTE_*.txt - -### JetBrains+all ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### JetBrains+all Patch ### -# Ignores the whole .idea folder and all .iml files -# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 - -.idea/ - -# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 - -*.iml -modules.xml -.idea/misc.xml -*.ipr - -# Sonarlint plugin -.idea/sonarlint - -### Rails ### -*.rbc -capybara-*.html -.rspec -/db/*.sqlite3 -/db/*.sqlite3-journal -/public/system -/coverage/ -/spec/tmp -rerun.txt -pickle-email-*.html - -# Ignore all logfiles and tempfiles. -/log/* -/tmp/* -!/log/.keep -!/tmp/.keep - -# TODO Comment out this rule if you are OK with secrets being uploaded to the repo -config/initializers/secret_token.rb -config/master.key - -# Only include if you have production secrets in this file, which is no longer a Rails default -# config/secrets.yml - -# dotenv -# TODO Comment out this rule if environment variables can be committed -.env - -## Environment normalization: -/.bundle -/vendor/bundle - -# these should all be checked in to normalize the environment: -# Gemfile.lock, .ruby-version, .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc - -# if using bower-rails ignore default bower_components path bower.json files -/vendor/assets/bower_components -*.bowerrc -bower.json - -# Ignore pow environment settings -.powenv - -# Ignore Byebug command history file. -.byebug_history - -# Ignore node_modules -node_modules/ - -# Ignore precompiled javascript packs -/public/packs -/public/packs-test -/public/assets - -# Ignore yarn files -/yarn-error.log -yarn-debug.log* -.yarn-integrity - -# Ignore uploaded files in development -/storage/* -!/storage/.keep - -### Ruby ### -*.gem -/.config -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -# Used by dotenv library to load environment variables. -# .env - -# Ignore Byebug command history file. - -## Specific to RubyMotion: -.dat* -.repl_history -build/ -*.bridgesupport -build-iPhoneOS/ -build-iPhoneSimulator/ - -## Specific to RubyMotion (use of CocoaPods): -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# vendor/Pods/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -/.bundle/ -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: - -# End of https://www.gitignore.io/api/git,ruby,rails,jetbrains+all -``` - ## Add a local database and persist data You can use containers to set up local services, like a database. In this section, you'll update the `compose.yaml` file to define a database service and a volume to persist data. @@ -335,7 +24,6 @@ In the cloned repository's directory, open the `compose.yaml` file in an IDE or The following is the updated `compose.yaml` file. ```yaml {hl_lines="10-30"} -version: '3' services: web: build: . @@ -386,28 +74,30 @@ You should now have the following contents in your `docker-ruby-on-rails` directory. ```text -├── docker-ruby-on-rails/ -├── app -├── bin -├── config -│── db/ -│ │ └─ password.txt -├── lib -├── log -├── public -├── storage -├── test -├── tmp -├── vendor -│ ├── .dockerignore -│ ├── .gitignore -│ ├── confi.ru -│ ├── Gemfile -│ ├── Gemfile.lock -│ ├── compose.yaml -│ ├── Rakefile -│ ├── Dockerfile -│ └── README.md +. +├── Dockerfile +├── Gemfile +├── Gemfile.lock +├── README.md +├── Rakefile +├── app/ +├── bin/ +├── compose.yaml +├── config/ +├── config.ru +├── db/ +│ ├── development.sqlite3 +│ ├── migrate +│ ├── password.txt +│ ├── schema.rb +│ └── seeds.rb +├── lib/ +├── log/ +├── public/ +├── storage/ +├── test/ +├── tmp/ +└── vendor ``` Now, run the following `docker compose up` command to start your application. @@ -415,8 +105,7 @@ Now, run the following `docker compose up` command to start your application. ```console $ docker compose up --build ``` - -Refresh http://localhost:3000 in your browser and verify that the Whale items persisted, even after the containers were removed and ran again. +Refresh in your browser and verify that the Whale items persisted, even after the containers were removed and ran again.u Press `ctrl+c` in the terminal to stop your application. From 2f050cf3cb701d0c62898a37c48640cfe1506c11 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Wed, 17 Jul 2024 13:38:59 -0600 Subject: [PATCH 06/13] Update develop md --- content/language/ruby/develop.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md index 3ecc832b351..d5cc9501965 100644 --- a/content/language/ruby/develop.md +++ b/content/language/ruby/develop.md @@ -105,7 +105,23 @@ Now, run the following `docker compose up` command to start your application. ```console $ docker compose up --build ``` -Refresh in your browser and verify that the Whale items persisted, even after the containers were removed and ran again.u + +In Ruby on Rails, `db:migrate` is a Rake task that is used to run migrations on the database. Migrations are a way to alter the structure of your database schema over time in a consistent and easy way. + +```console +$ docker exec -it docker-ruby-on-rails-web-1 rake db:migrate RAILS_ENV=test +``` + +You will see a similar message like this: + +``console +== 20240710193146 CreateWhales: migrating ===================================== +-- create_table(:whales) + -> 0.0126s +== 20240710193146 CreateWhales: migrated (0.0127s) ============================ +`` + +Refresh in your browser and verify that the Whale items persisted, even after the containers were removed and ran again. Press `ctrl+c` in the terminal to stop your application. From 60a1226f28d134f5ff7a166f3edc70bfb9a8d391 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Wed, 17 Jul 2024 13:43:21 -0600 Subject: [PATCH 07/13] Add whales --- content/language/ruby/develop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md index d5cc9501965..948f2a90617 100644 --- a/content/language/ruby/develop.md +++ b/content/language/ruby/develop.md @@ -121,9 +121,9 @@ You will see a similar message like this: == 20240710193146 CreateWhales: migrated (0.0127s) ============================ `` -Refresh in your browser and verify that the Whale items persisted, even after the containers were removed and ran again. +Refresh in your browser and add the whales. -Press `ctrl+c` in the terminal to stop your application. +Press `ctrl+c` in the terminal to stop your application and run `docker compose up` again, the whales are being persisted. ## Automatically update services From 6bf3be30b3db5c35e1a6a97b6fe425b026e224f9 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Wed, 17 Jul 2024 13:57:45 -0600 Subject: [PATCH 08/13] Add env file --- content/language/ruby/develop.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md index 948f2a90617..bc6c6140c6b 100644 --- a/content/language/ruby/develop.md +++ b/content/language/ruby/develop.md @@ -23,7 +23,7 @@ In the cloned repository's directory, open the `compose.yaml` file in an IDE or The following is the updated `compose.yaml` file. -```yaml {hl_lines="10-30"} +```yaml {hl_lines="09-30"} services: web: build: . @@ -34,11 +34,9 @@ services: - "3000:3000" depends_on: - db - secrets: - - db-password environment: - - POSTGRES_PASSWORD_FILE=/run/secrets/db-password - RAILS_ENV=test + env_file: "webapp.env" db: image: postgres:latest secrets: @@ -68,7 +66,7 @@ In the cloned repository's directory, create a new directory named `db` and insi mysecretpassword ``` -Save and close the `password.txt` file. +Save and close the `password.txt` file. In addition, in the file `webapp.env` you can change the password to connect to the database. You should now have the following contents in your `docker-ruby-on-rails` directory. From 19028fa2ddd5d6cc1cf2ba7af032680d933bb8a7 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Wed, 24 Jul 2024 09:22:29 -0600 Subject: [PATCH 09/13] Apply changes --- content/language/ruby/deploy.md | 4 ++-- content/language/ruby/develop.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/language/ruby/deploy.md b/content/language/ruby/deploy.md index 93c9a7295d5..cf9a5d40059 100644 --- a/content/language/ruby/deploy.md +++ b/content/language/ruby/deploy.md @@ -11,7 +11,7 @@ description: Learn how to develop locally using Kubernetes ## Overview -In this section, you'll learn how to use Docker Desktop to deploy your application to a fully-featured Kubernetes environment on your development machine. This allows you to test and debug your workloads on Kubernetes locally before deploying. +In this section, you'll learn how to use Docker Desktop to deploy your application to a fully-featured Kubernetes environment on your development machine. This lets you to test and debug your workloads on Kubernetes locally before deploying. ## Create a Kubernetes YAML file @@ -120,7 +120,7 @@ To learn more about Kubernetes objects, see the [Kubernetes documentation](https ``` -3. Open the browser and go to http://localhost:30001/, you should see the ruby on rails application working. +3. Open the browser and go to HTTP://localhost:30001/, you should see the ruby on rails application working. Note that a database was not deployed in this example. 4. Run the following command to tear down your application. diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md index bc6c6140c6b..60cc350260b 100644 --- a/content/language/ruby/develop.md +++ b/content/language/ruby/develop.md @@ -19,7 +19,7 @@ In this section, you'll learn how to set up a development environment for your c You can use containers to set up local services, like a database. In this section, you'll update the `compose.yaml` file to define a database service and a volume to persist data. -In the cloned repository's directory, open the `compose.yaml` file in an IDE or text editor. Yyou need to add the database password file as an environment variable to the server service and specify the secret file to use . +In the cloned repository's directory, open the `compose.yaml` file in an IDE or text editor. You need to add the database password file as an environment variable to the server service and specify the secret file to use . The following is the updated `compose.yaml` file. From e9e3fa8e676be043923643ab023d7207f00e6f87 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Thu, 25 Jul 2024 08:48:02 -0600 Subject: [PATCH 10/13] Apply feedback from craig --- content/language/ruby/deploy.md | 35 ++++++++++++++++++++++++++------ content/language/ruby/develop.md | 14 ++++--------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/content/language/ruby/deploy.md b/content/language/ruby/deploy.md index cf9a5d40059..38474713026 100644 --- a/content/language/ruby/deploy.md +++ b/content/language/ruby/deploy.md @@ -110,20 +110,43 @@ To learn more about Kubernetes objects, see the [Kubernetes documentation](https ```shell NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes ClusterIP 10.96.0.1 443/TCP 23h - docker-ruby-on-rails-demo NodePort 10.99.128.230 8001:30001/TCP 75s + docker-ruby-on-rails-demo NodePort 10.99.128.230 3000:30001/TCP 75s ``` In addition to the default `kubernetes` service, you can see your `docker-ruby-on-rails-demo` service, accepting traffic on port 30001/TCP. - Create and migrate the database + + +3. To create and migrate the database in a Ruby on Rails application running on Kubernetes, you need to follow these steps. + + **Get the Current Pods**: + First, you need to identify the pods running in your Kubernetes cluster. Execute the following command to list the current pods in the `default` namespace: + + ```sh + # Get the current pods in the cluster in the namespace default + $ kubectl get pods + ``` + + This command will display a list of all pods in the `default` namespace. Look for the pod with the prefix `docker-ruby-on-rails-demo-`. Here is an example output: + + ```console + NAME READY STATUS RESTARTS AGE + docker-ruby-on-rails-demo-7cbddb5d6f-qh44l 1/1 Running 2 (22h ago) 9d ``` - kubectl exec -it -- rails db:migrate RAILS_ENV=development + **Execute the Migration Command**: + Once you've identified the correct pod, use the `kubectl exec` command to run the database migration inside the pod. + + ```sh + $ kubectl exec -it docker-ruby-on-rails-demo-7cbddb5d6f-qh44l -- rails db:migrate RAILS_ENV=development ``` -3. Open the browser and go to HTTP://localhost:30001/, you should see the ruby on rails application working. - Note that a database was not deployed in this example. + This command opens an interactive terminal session (`-it`) in the specified pod and runs the `rails db:migrate` command with the environment set to development (`RAILS_ENV=development`). + + By following these steps, you ensure that your database is properly migrated within the Ruby on Rails application running in your Kubernetes cluster. This process helps maintain the integrity and consistency of your application's data structure during deployment and updates. + +4. Open the browser and go to [http://localhost:30001](http://localhost:30001), you should see the ruby on rails application working. -4. Run the following command to tear down your application. +5. Run the following command to tear down your application. ```console $ kubectl delete -f docker-ruby-on-rails-kubernetes.yaml diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md index 60cc350260b..3dccb48ad8e 100644 --- a/content/language/ruby/develop.md +++ b/content/language/ruby/develop.md @@ -19,7 +19,7 @@ In this section, you'll learn how to set up a development environment for your c You can use containers to set up local services, like a database. In this section, you'll update the `compose.yaml` file to define a database service and a volume to persist data. -In the cloned repository's directory, open the `compose.yaml` file in an IDE or text editor. You need to add the database password file as an environment variable to the server service and specify the secret file to use . +In the cloned repository's directory, open the `compose.yaml` file in an IDE or text editor. You need to add the database password file as an environment variable to the server service and specify the secret file to use. The following is the updated `compose.yaml` file. @@ -28,8 +28,6 @@ services: web: build: . command: bundle exec rails s -b '0.0.0.0' - volumes: - - .:/myapp ports: - "3000:3000" depends_on: @@ -132,23 +130,19 @@ Watch](../../compose/file-watch.md). Open your `compose.yaml` file in an IDE or text editor and then add the Compose Watch instructions. The following is the updated `compose.yaml` file. -```yaml {hl_lines="17-2 0"} -version: '3' +```yaml {hl_lines="16-19"} services: web: build: . command: bundle exec rails s -b '0.0.0.0' - volumes: - - .:/myapp ports: - "3000:3000" depends_on: - db - secrets: - - db-password environment: - - POSTGRES_PASSWORD_FILE=/run/secrets/db-password - RAILS_ENV=test + env_file: "webapp.env" + develop: watch: - action: rebuild From e843221650c0a4a0a888e67ab6b951c9168080a2 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Mon, 29 Jul 2024 12:14:11 -0600 Subject: [PATCH 11/13] Delete mr64 --- content/language/ruby/configure-ci-cd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/language/ruby/configure-ci-cd.md b/content/language/ruby/configure-ci-cd.md index db32c44f65d..b54d7b112e7 100644 --- a/content/language/ruby/configure-ci-cd.md +++ b/content/language/ruby/configure-ci-cd.md @@ -88,7 +88,7 @@ to Docker Hub. name: Build and push uses: docker/build-push-action@v6 with: - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest ``` From 1a7792e434cebfef11f8d9a3ef68b871e88467fe Mon Sep 17 00:00:00 2001 From: Gerardo Lopez Date: Tue, 30 Jul 2024 16:18:00 -0600 Subject: [PATCH 12/13] apply feedback --- content/language/ruby/develop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/language/ruby/develop.md b/content/language/ruby/develop.md index 3dccb48ad8e..3738e8cd6a4 100644 --- a/content/language/ruby/develop.md +++ b/content/language/ruby/develop.md @@ -23,7 +23,7 @@ In the cloned repository's directory, open the `compose.yaml` file in an IDE or The following is the updated `compose.yaml` file. -```yaml {hl_lines="09-30"} +```yaml {hl_lines="07-25"} services: web: build: . @@ -130,7 +130,7 @@ Watch](../../compose/file-watch.md). Open your `compose.yaml` file in an IDE or text editor and then add the Compose Watch instructions. The following is the updated `compose.yaml` file. -```yaml {hl_lines="16-19"} +```yaml {hl_lines="13-16"} services: web: build: . From f9bfab8fc0e426e79905e477e92fe5faddd2edd5 Mon Sep 17 00:00:00 2001 From: Gerardo Lopez <143828508+falconcr@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:39:09 -0600 Subject: [PATCH 13/13] Add java 21 (#1) --- content/guides/java/containerize.md | 6 +++--- content/guides/java/develop.md | 4 ++-- content/guides/java/run-tests.md | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/content/guides/java/containerize.md b/content/guides/java/containerize.md index c4c69e2a917..b6eb64f61c2 100644 --- a/content/guides/java/containerize.md +++ b/content/guides/java/containerize.md @@ -68,7 +68,7 @@ WARNING: The following Docker files already exist in this directory: ? Do you want to overwrite them? Yes ? What application platform does your project use? Java ? What's the relative directory (with a leading .) for your app? ./src -? What version of Java do you want to use? 17 +? What version of Java do you want to use? 21 ? What port does your server listen on? 8080 ``` @@ -98,7 +98,7 @@ Create a file named `Dockerfile` with the following contents. ################################################################################ # Create a stage for resolving and downloading dependencies. -FROM eclipse-temurin:17-jdk-jammy as deps +FROM eclipse-temurin:21-jre-jammy as deps WORKDIR /build @@ -155,7 +155,7 @@ RUN java -Djarmode=layertools -jar target/app.jar extract --destination target/e # most recent version of that tag when you build your Dockerfile. # If reproducability is important, consider using a specific digest SHA, like # eclipse-temurin@sha256:99cede493dfd88720b610eb8077c8688d3cca50003d76d1d539b0efc8cca72b4. -FROM eclipse-temurin:17-jre-jammy AS final +FROM eclipse-temurin:21-jre-jammy AS final # Create a non-privileged user that the app will run under. # See https://docs.docker.com/go/dockerfile-user-best-practices/ diff --git a/content/guides/java/develop.md b/content/guides/java/develop.md index f66aa830296..e3cee724fe9 100644 --- a/content/guides/java/develop.md +++ b/content/guides/java/develop.md @@ -121,7 +121,7 @@ Replace the contents of your Dockerfile with the following. ```dockerfile {hl_lines="22-29"} # syntax=docker/dockerfile:1 -FROM eclipse-temurin:17-jdk-jammy as deps +FROM eclipse-temurin:21-jdk-jammy as deps WORKDIR /build COPY --chmod=0755 mvnw mvnw COPY .mvn/ .mvn/ @@ -149,7 +149,7 @@ RUN cp -r /build/target/extracted/application/. ./ ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000 CMD [ "java", "-Dspring.profiles.active=postgres", "org.springframework.boot.loader.launch.JarLauncher" ] -FROM eclipse-temurin:17-jre-jammy AS final +FROM eclipse-temurin:21-jre-jammy AS final ARG UID=10001 RUN adduser \ --disabled-password \ diff --git a/content/guides/java/run-tests.md b/content/guides/java/run-tests.md index 44cc87be180..808afcad4ce 100644 --- a/content/guides/java/run-tests.md +++ b/content/guides/java/run-tests.md @@ -25,7 +25,7 @@ Replace the contents of your Dockerfile with the following. ```dockerfile {hl_lines="3-19"} # syntax=docker/dockerfile:1 -FROM eclipse-temurin:17-jdk-jammy as base +FROM eclipse-temurin:21-jre-jammy as base WORKDIR /build COPY --chmod=0755 mvnw mvnw COPY .mvn/ .mvn/ @@ -64,7 +64,7 @@ RUN cp -r /build/target/extracted/application/. ./ ENV JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000" CMD [ "java", "-Dspring.profiles.active=postgres", "org.springframework.boot.loader.launch.JarLauncher" ] -FROM eclipse-temurin:17-jre-jammy AS final +FROM eclipse-temurin:21-jre-jammy AS final ARG UID=10001 RUN adduser \ --disabled-password \