Skip to content

Commit 858f5ce

Browse files
aevesdockerduffuniversesarahsanders-dockerk-kbkcraig-osterhout
authored
publish updates from main (#22321)
Automated pull request for publishing docs updates. --------- Signed-off-by: Craig <[email protected]> Signed-off-by: CrazyMax <[email protected]> Signed-off-by: Lorena Rangel <[email protected]> Co-authored-by: aevesdocker <[email protected]> Co-authored-by: Allie Sadler <[email protected]> Co-authored-by: Andrey Sobolev <[email protected]> Co-authored-by: Sarah Sanders <[email protected]> Co-authored-by: Bokyeom <[email protected]> Co-authored-by: Craig Osterhout <[email protected]> Co-authored-by: Marco Franzon <[email protected]> Co-authored-by: CrazyMax <[email protected]> Co-authored-by: yinzhidong <[email protected]> Co-authored-by: Lorena Rangel <[email protected]>
2 parents 3648cad + fe639f9 commit 858f5ce

File tree

30 files changed

+674
-132
lines changed

30 files changed

+674
-132
lines changed

_vale/config/vocabularies/Docker/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Datadog
2020
Ddosify
2121
Debootstrap
2222
Dev
23+
Dex
2324
Dev Environments?
2425
Django
2526
Docker Build Cloud

content/get-started/docker-concepts/running-containers/overriding-container-defaults.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ In this hands-on guide, you'll see how to use the `docker run` command to overri
7171

7272
1. [Download and install](/get-started/get-docker/) Docker Desktop.
7373

74-
### Run multiple instance of the Postgres database
74+
### Run multiple instances of the Postgres database
7575

7676
1. Start a container using the [Postgres image](https://hub.docker.com/_/postgres) with the following command:
7777

content/guides/databases.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ To run a container using the GUI:
7878
1. In the Docker Desktop Dashboard, select the global search at the top of the window.
7979
2. Specify `mysql` in the search box, and select the `Images` tab if not already
8080
selected.
81-
3. Hover over the `msyql` image and select `Run`.
82-
The **Run a new container** model appears.
81+
3. Hover over the `mysql` image and select `Run`.
82+
The **Run a new container** modal appears.
8383
4. Expand **Optional settings**.
8484
5. In the optional settings, specify the following:
8585

@@ -181,7 +181,7 @@ interact with your MySQL database.
181181
Before you begin, you must remove any containers you previously ran for this
182182
guide. To stop and remove a container, either:
183183

184-
- In a terminal, run `docker remove --force my-mysql` to remove the container
184+
- In a terminal, run `docker rm --force my-mysql` to remove the container
185185
named `my-mysql`.
186186
- Or, in the Docker Desktop Dashboard, select the **Delete** icon next to your
187187
container in the **Containers** view.
@@ -221,8 +221,8 @@ To run a container using the GUI:
221221
1. In the Docker Desktop Dashboard, select the global search at the top of the window.
222222
2. Specify `mysql` in the search box, and select the `Images` tab if not already
223223
selected.
224-
3. Hover over the `msyql` image and select `Run`.
225-
The **Run a new container** model appears.
224+
3. Hover over the `mysql` image and select `Run`.
225+
The **Run a new container** modal appears.
226226
4. Expand **Optional settings**.
227227
5. In the optional settings, specify the following:
228228

@@ -392,7 +392,7 @@ data persists:
392392
2. Specify `mysql` in the search box, and select the **Images** tab if not
393393
already selected.
394394
3. Hover over the **mysql** image and select **Run**.
395-
The **Run a new container** model appears.
395+
The **Run a new container** modal appears.
396396
4. Expand **Optional settings**.
397397
5. In the optional settings, specify the following:
398398

@@ -433,7 +433,7 @@ data persists:
433433
2. Specify `mysql` in the search box, and select the **Images** tab if not
434434
already selected.
435435
3. Hover over the **mysql** image and select **Run**.
436-
The **Run a new container** model appears.
436+
The **Run a new container** modal appears.
437437
4. Expand **Optional settings**.
438438
5. In the optional settings, specify the following:
439439

content/guides/dex.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
title: Mocking OAuth services in testing with Dex
3+
description: &desc Mocking OAuth services in testing with Dex
4+
keywords: Dex, container-supported development
5+
linktitle: Mocking OAuth services with Dex
6+
summary: *desc
7+
tags: [app-dev, distributed-systems]
8+
languages: []
9+
params:
10+
time: 10 minutes
11+
---
12+
13+
Dex is an open-source OpenID Connect (OIDC) and OAuth 2.0 identity provider that can be configured to authenticate against various backend identity providers, such as LDAP, SAML, and OAuth. Running Dex in a Docker container allows developers to simulate an OAuth 2.0 server for testing and development purposes. This guide will walk you through setting up Dex as an OAuth mock server using Docker containers.
14+
15+
Nowadays OAuth is the preferred choice to authenticate in web services, the highest part of them give the possibility to access using popular OAuth services like GitHub, Google or Apple. Using OAuth guarantees a higher level of security and simplification since it is not necessary to create new profiles for each service. This means that, by allowing applications to access resources on behalf of users without sharing passwords, OAuth minimizes the risk of credential exposure.
16+
17+
In this guide, you'll learn how to:
18+
19+
- Use Docker to launch up a Dex container.
20+
- Use mock OAuth in the GitHub Action (GHA) without relying on an external OAuth provider.
21+
22+
## Using Dex with Docker
23+
24+
The official [Docker image for Dex](https://hub.docker.com/r/dexidp/dex/) provides a convenient way to deploy and manage Dex instances. Dex is available for various CPU architectures, including amd64, armv7, and arm64, ensuring compatibility with different devices and platforms. You can learn more about Dex standalone on the [Dex docs site](https://dexidp.io/docs/getting-started/).
25+
26+
### Prerequisites
27+
28+
[Docker Compose](/compose/): Recommended for managing multi-container Docker applications.
29+
30+
### Setting Up Dex with Docker
31+
32+
Begin by creating a directory for your Dex project:
33+
34+
```bash
35+
mkdir dex-mock-server
36+
cd dex-mock-server
37+
```
38+
Organize your project with the following structure:
39+
40+
```bash
41+
dex-mock-server/
42+
├── config.yaml
43+
└── compose.yaml
44+
```
45+
46+
Create the Dex Configuration File:
47+
The config.yaml file defines Dex's settings, including connectors, clients, and storage. For a mock server setup, you can use the following minimal configuration:
48+
49+
```yaml
50+
# config.yaml
51+
issuer: http://localhost:5556/dex
52+
storage:
53+
type: memory
54+
web:
55+
http: 0.0.0.0:5556
56+
staticClients:
57+
- id: example-app
58+
redirectURIs:
59+
- 'http://localhost:5555/callback'
60+
name: 'Example App'
61+
secret: ZXhhbXBsZS1hcHAtc2VjcmV0
62+
enablePasswordDB: true
63+
staticPasswords:
64+
- email: "[email protected]"
65+
hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W"
66+
username: "admin"
67+
userID: "1234"
68+
```
69+
70+
Explanation:
71+
- issuer: The public URL of Dex.
72+
73+
- storage: Using in-memory storage for simplicity.
74+
75+
- web: Dex will listen on port 5556.
76+
77+
- staticClients: Defines a client application (example-app) with its redirect URI and secret.
78+
79+
- enablePasswordDB: Enables static password authentication.
80+
81+
- staticPasswords: Defines a static user for authentication. The hash is a bcrypt hash of the password.
82+
83+
> [!NOTE]
84+
>
85+
> Ensure the hash is a valid bcrypt hash of your desired password. You can generate this using tools like [bcrypt-generator.com](https://bcrypt-generator.com/).
86+
or use CLI tools like [htpasswd](https://httpd.apache.org/docs/2.4/programs/htpasswd.html) like in this following example:`echo password | htpasswd -BinC 10 admin | cut -d: -f2`
87+
88+
With Docker Compose configured, start Dex:
89+
```yaml
90+
# docker-compose.yaml
91+
92+
services:
93+
dex:
94+
image: dexidp/dex:latest
95+
container_name: dex
96+
ports:
97+
- "5556:5556"
98+
volumes:
99+
- ./config.yaml:/etc/dex/config.yaml
100+
command: ["dex", "serve", "/etc/dex/config.yaml"]
101+
```
102+
103+
Now it is possible to run the container using the `docker compose` command.
104+
```bash
105+
docker compose up -d
106+
```
107+
108+
This command will download the Dex Docker image (if not already available) and start the container in detached mode.
109+
110+
111+
To verify that Dex is running, check the logs to ensure Dex started successfully:
112+
```bash
113+
docker compose logs -f dex
114+
```
115+
You should see output indicating that Dex is listening on the specified port.
116+
117+
### Using Dex OAuth testing in GHA
118+
119+
To test the OAuth flow, you'll need a client application configured to authenticate against Dex. One of the most typical use cases is to use it inside GitHub Actions. Since Dex supports mock authentication, you can predefine test users as suggested in the [docs](https://dexidp.io/docs). The `config.yaml` file should looks like:
120+
121+
```yaml
122+
issuer: http://127.0.0.1:5556/dex
123+
124+
storage:
125+
type: memory
126+
127+
web:
128+
http: 0.0.0.0:5556
129+
130+
oauth2:
131+
skipApprovalScreen: true
132+
133+
staticClients:
134+
- name: TestClient
135+
id: client_test_id
136+
secret: client_test_secret
137+
redirectURIs:
138+
- http://{ip-your-app}/path/to/callback/ # example: http://localhost:5555/callback
139+
140+
connectors:
141+
# mockCallback connector always returns the user '[email protected]'.
142+
- type: mockCallback
143+
id: mock
144+
name: Mock
145+
```
146+
Now you can insert the Dex service inside your `~/.github/workflows/ci.yaml` file:
147+
148+
```yaml
149+
[...]
150+
jobs:
151+
test-oauth:
152+
runs-on: ubuntu-latest
153+
steps:
154+
- name: Install Dex
155+
run: |
156+
curl -L https://github.com/dexidp/dex/releases/download/v2.37.0/dex_linux_amd64 -o dex
157+
chmod +x dex
158+
159+
- name: Start Dex Server
160+
run: |
161+
nohup ./dex serve config.yaml > dex.log 2>&1 &
162+
sleep 5 # Give Dex time to start
163+
[...]
164+
```
165+
166+
167+
### Conclusion
168+
169+
By following this guide, you've set up Dex as an OAuth mock server using Docker. This setup is invaluable for testing and development, allowing you to simulate OAuth flows without relying on external identity providers. For more advanced configurations and integrations, refer to the [Dex documentation](https://dexidp.io/docs/).

content/guides/golang/develop.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ In this section, you'll create a Docker Compose file to start your `docker-gs-pi
521521

522522
### Configure Docker Compose
523523

524-
In your application's directory, create a new text file named `docker-compose.yml` with the following content.
524+
In your application's directory, create a new text file named `compose.yaml` with the following content.
525525

526526
```yaml
527527
version: "3.8"
@@ -582,7 +582,7 @@ The exact value doesn't really matter for this example, because you run Cockroac
582582

583583
### Merging Compose files
584584

585-
The file name `docker-compose.yml` is the default file name which `docker compose` command recognizes if no `-f` flag is provided. This means you can have multiple Docker Compose files if your environment has such requirements. Furthermore, Docker Compose files are... composable (pun intended), so multiple files can be specified on the command line to merge parts of the configuration together. The following list is just a few examples of scenarios where such a feature would be very useful:
585+
The file name `compose.yaml` is the default file name which `docker compose` command recognizes if no `-f` flag is provided. This means you can have multiple Docker Compose files if your environment has such requirements. Furthermore, Docker Compose files are... composable (pun intended), so multiple files can be specified on the command line to merge parts of the configuration together. The following list is just a few examples of scenarios where such a feature would be very useful:
586586

587587
- Using a bind mount for the source code for local development but not when running the CI tests;
588588
- Switching between using a pre-built image for the frontend for some API application vs creating a bind mount for source code;
@@ -608,7 +608,7 @@ Before you apply changes made to a Compose configuration file, there is an oppor
608608
$ docker compose config
609609
```
610610

611-
When this command is run, Docker Compose reads the file `docker-compose.yml`, parses it into a data structure in memory, validates where possible, and prints back the reconstruction of that configuration file from its internal representation. If this isn't possible due to errors, Docker prints an error message instead.
611+
When this command is run, Docker Compose reads the file `compose.yaml`, parses it into a data structure in memory, validates where possible, and prints back the reconstruction of that configuration file from its internal representation. If this isn't possible due to errors, Docker prints an error message instead.
612612

613613
### Build and run the application using Docker Compose
614614

content/guides/java/containerize.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ services:
204204
# start the database before your application. The `db-data` volume persists the
205205
# database data between container restarts. The `db-password` secret is used
206206
# to set the database password. You must create `db/password.txt` and add
207-
# a password of your choosing to it before running `docker-compose up`.
207+
# a password of your choosing to it before running `docker compose up`.
208208
# depends_on:
209209
# db:
210210
# condition: service_healthy

content/guides/nodejs/containerize.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ services:
141141
# start the database before your application. The `db-data` volume persists the
142142
# database data between container restarts. The `db-password` secret is used
143143
# to set the database password. You must create `db/password.txt` and add
144-
# a password of your choosing to it before running `docker-compose up`.
144+
# a password of your choosing to it before running `docker compose up`.
145145
# depends_on:
146146
# db:
147147
# condition: service_healthy

content/guides/nodejs/develop.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ You can use containers to set up local services, like a database. In this sectio
5858
# start the database before your application. The `db-data` volume persists the
5959
# database data between container restarts. The `db-password` secret is used
6060
# to set the database password. You must create `db/password.txt` and add
61-
# a password of your choosing to it before running `docker-compose up`.
61+
# a password of your choosing to it before running `docker compose up`.
6262

6363
depends_on:
6464
db:
@@ -128,7 +128,7 @@ You can use containers to set up local services, like a database. In this sectio
128128
# start the database before your application. The `db-data` volume persists the
129129
# database data between container restarts. The `db-password` secret is used
130130
# to set the database password. You must create `db/password.txt` and add
131-
# a password of your choosing to it before running `docker-compose up`.
131+
# a password of your choosing to it before running `docker compose up`.
132132

133133
depends_on:
134134
db:
@@ -188,7 +188,7 @@ You can use containers to set up local services, like a database. In this sectio
188188
# start the database before your application. The `db-data` volume persists the
189189
# database data between container restarts. The `db-password` secret is used
190190
# to set the database password. You must create `db/password.txt` and add
191-
# a password of your choosing to it before running `docker-compose up`.
191+
# a password of your choosing to it before running `docker compose up`.
192192

193193
depends_on:
194194
db:

content/includes/hub-limits.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

content/manuals/billing/history.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: View billing history
33
weight: 40
44
description: Discover how to view your billing history in Docker Hub
55
keywords: payments, billing, subscription, invoices, renewals, invoice management, billing administration
6+
aliases:
7+
- /billing/core-billing/history/
68
---
79

810
In this section, learn how you can view your billing history, manage your invoices, and verify your renewal date. All monthly and annual subscriptions are automatically renewed at the end of the term using the original form of payment.

0 commit comments

Comments
 (0)