Skip to content

Commit 1b32804

Browse files
committed
fix docker commands
1 parent 3304127 commit 1b32804

File tree

22 files changed

+258
-169
lines changed

22 files changed

+258
-169
lines changed

pages/public_cloud/ai_machine_learning/deploy_tuto_01_streamlit/guide.en-gb.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,28 @@ WORKDIR /workspace
9898
- More information about Dockerfiles can be found [here](https://docs.docker.com/engine/reference/builder/)
9999
- Direct link to the full Dockerfile can be found here [here](https://github.com/ovh/ai-training-examples/tree/main/apps/streamlit/simple-app/Dockerfile)
100100

101-
### Build the docker image from the dockerfile
101+
### Build the Docker image from the Dockerfile
102102

103-
Launch the following command from the **Dockerfile** directory to build your application image.
103+
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:
104104

105-
``` {.console}
105+
```console
106+
# Build the image using your machine's default architecture
106107
docker build . -t streamlit-example:latest
108+
109+
# Build image targeting the linux/amd64 architecture
110+
docker buildx build --platform linux/amd64 -t streamlit-example:latest .
107111
```
108112

109-
> [!primary]
110-
>
111-
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
113+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
114+
115+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
112116

113117
> [!primary]
114118
>
115-
> The `-t` argument allow you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **streamlit-example:latest**.
116-
117-
> [!warning]
119+
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
118120
>
119-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
121+
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **streamlit-example:latest**.
120122
>
121-
> `docker buildx build --platform linux/amd64 ...`
122123
123124
### Test it locally (optional)
124125

pages/public_cloud/ai_machine_learning/deploy_tuto_02_flask/guide.en-gb.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,27 @@ ENV HOME=/workspace
100100

101101
### Build the Docker image from the Dockerfile
102102

103-
Launch the following command from the Dockerfile directory to build your application image:
103+
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:
104104

105105
```console
106+
# Build the image using your machine's default architecture
106107
docker build . -t flask-app:latest
108+
109+
# Build image targeting the linux/amd64 architecture
110+
docker buildx build --platform linux/amd64 -t flask-app:latest .
107111
```
108112

113+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
114+
115+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
116+
109117
> [!primary]
110118
>
111119
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
112120
>
113121
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **flask-app:latest**.
114122
>
115123
116-
> [!warning]
117-
>
118-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
119-
>
120-
> `docker buildx build --platform linux/amd64 ...`
121-
>
122-
123124
### Test it locally (optional)
124125

125126
Launch the following **docker command** to launch your application locally on your computer:

pages/public_cloud/ai_machine_learning/deploy_tuto_03_streamlit_sounds_classification/guide.en-gb.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,26 +248,27 @@ ENV HOME=/workspace
248248

249249
### Build the Docker image from the Dockerfile
250250

251-
Launch the following command from the **Dockerfile** directory to build your application image:
251+
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:
252252

253253
```console
254+
# Build the image using your machine's default architecture
254255
docker build . -t streamlit_app:latest
256+
257+
# Build image targeting the linux/amd64 architecture
258+
docker buildx build --platform linux/amd64 -t streamlit_app:latest .
255259
```
256260

261+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
262+
263+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
264+
257265
> [!primary]
258266
>
259267
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
260268
>
261269
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **streamlit_app:latest**.
262270
>
263271
264-
> [!warning]
265-
>
266-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
267-
>
268-
> `docker buildx build --platform linux/amd64 ...`
269-
>
270-
271272
### Test it locally (optional)
272273

273274
Launch the following **Docker command** to launch your application locally on your computer:

pages/public_cloud/ai_machine_learning/deploy_tuto_04_flask_yolov5/guide.en-gb.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,25 +204,26 @@ ENV HOME=/workspace
204204

205205
### Build the Docker image from the Dockerfile
206206

207-
Launch the following command from the **Dockerfile** directory to build your application image:
207+
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:
208208

209-
``` {.console}
209+
```console
210+
# Build the image using your machine's default architecture
210211
docker build . -t flask-yolov5:latest
212+
213+
# Build image targeting the linux/amd64 architecture
214+
docker buildx build --platform linux/amd64 -t flask-yolov5:latest .
211215
```
212216

217+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
218+
219+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
220+
213221
> [!primary]
214222
>
215223
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
216-
217-
> [!primary]
218224
>
219225
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **flask-yolov5:latest**.
220-
221-
> [!warning]
222-
>
223-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
224226
>
225-
> `docker buildx build --platform linux/amd64 ...`
226227
227228
### Test it locally (optional)
228229

pages/public_cloud/ai_machine_learning/deploy_tuto_06_flask_hugging_face/guide.en-gb.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,27 @@ ENV HOME=/workspace
155155

156156
### Build the Docker image from the Dockerfile
157157

158-
Launch the following command from the **Dockerfile** directory to build your application image:
158+
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:
159159

160160
```console
161+
# Build the image using your machine's default architecture
161162
docker build . -t sentiment_analysis_app:latest
163+
164+
# Build image targeting the linux/amd64 architecture
165+
docker buildx build --platform linux/amd64 -t sentiment_analysis_app:latest .
162166
```
163167

168+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
169+
170+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
171+
164172
> [!primary]
165173
>
166174
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
167175
>
168176
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **sentiment_analysis_app:latest**.
169177
>
170178
171-
> [!warning]
172-
>
173-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
174-
>
175-
> `docker buildx build --platform linux/amd64 ...`
176-
>
177-
178179
### Test it locally (optional)
179180

180181
Launch the following **Docker command** to launch your application locally on your computer:

pages/public_cloud/ai_machine_learning/deploy_tuto_07_streamlit_eda_iris/guide.en-gb.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,26 +258,27 @@ ENV HOME=/workspace
258258

259259
### Build the Docker image from the Dockerfile
260260

261-
Launch the following command from the **Dockerfile** directory to build your application image:
261+
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:
262262

263263
```console
264+
# Build the image using your machine's default architecture
264265
docker build . -t streamlit-eda-iris:latest
266+
267+
# Build image targeting the linux/amd64 architecture
268+
docker buildx build --platform linux/amd64 -t streamlit-eda-iris:latest .
265269
```
266270

271+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
272+
273+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
274+
267275
> [!primary]
268276
>
269277
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
270278
>
271279
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **streamlit-eda-iris:latest**.
272280
>
273281
274-
> [!warning]
275-
>
276-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
277-
>
278-
> `docker buildx build --platform linux/amd64 ...`
279-
>
280-
281282
### Test it locally (optional)
282283

283284
Launch the following **Docker command** to launch your application locally on your computer:

pages/public_cloud/ai_machine_learning/deploy_tuto_08_fastapi_spam_classifier/guide.en-gb.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,26 +249,27 @@ ENV HOME=/workspace
249249

250250
### Build the Docker image from the Dockerfile
251251

252-
Launch the following command from the **Dockerfile** directory to build your application image:
252+
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:
253253

254254
```console
255+
# Build the image using your machine's default architecture
255256
docker build . -t fastapi-spam-classification:latest
257+
258+
# Build image targeting the linux/amd64 architecture
259+
docker buildx build --platform linux/amd64 -t fastapi-spam-classification:latest .
256260
```
257261

262+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
263+
264+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
265+
258266
> [!primary]
259267
>
260268
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
261269
>
262270
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **fastapi-spam-classification:latest**.
263271
>
264272
265-
> [!warning]
266-
>
267-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
268-
>
269-
> `docker buildx build --platform linux/amd64 ...`
270-
>
271-
272273
### Test it locally (optional)
273274

274275
Launch the following **Docker command** to launch your application locally on your computer:

pages/public_cloud/ai_machine_learning/deploy_tuto_09_streamlit_speech_to_text_app/guide.en-gb.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,25 @@ ENV HOME=/workspace
116116

117117
### Build the Docker image from the Dockerfile
118118

119-
Before continuing, **make sure you are in the directory containing the application files** (requirements.txt, packages.txt, Dockerfile, python files).
120-
121-
Once you are in it, launch the following command to build your application image:
119+
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:
122120

123121
```console
122+
# Build the image using your machine's default architecture
124123
docker build . -t streamlit_app:latest
124+
125+
# Build image targeting the linux/amd64 architecture
126+
docker buildx build --platform linux/amd64 -t streamlit_app:latest .
125127
```
126128

129+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
130+
131+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
132+
127133
> [!primary]
128134
>
129135
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
130136
>
131-
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example, we choose **streamlit_app:latest**.
132-
>
133-
134-
> [!warning]
135-
>
136-
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
137-
>
138-
> `docker buildx build --platform linux/amd64 ...`
137+
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **streamlit_app:latest**.
139138
>
140139
141140
### Push the image into the shared registry

pages/public_cloud/ai_machine_learning/deploy_tuto_11_rasa_chatbot_flask/guide.en-gb.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,39 @@ EXPOSE 5005
133133
CMD rasa run -m trained-models --cors "*" --debug --connector socketio --credentials "crendentials.yml" --endpoints "endpoints.yml" & rasa run actions
134134
```
135135

136-
Now run the following command in this folder (`/apps/flask/conversational-rasa-chatbot/back-end/`) to build and push the container:
136+
#### Build the Docker image from the Dockerfile
137+
138+
From the directory containing your **Dockerfile** (`/apps/flask/conversational-rasa-chatbot/back-end/`), run one of the following commands to build your application image:
139+
140+
```console
141+
# Build the image using your machine's default architecture
142+
docker build . -f rasa.Dockerfile -t <yourdockerhubId>/rasa-chatbot-backend:latest
143+
144+
# Build image targeting the linux/amd64 architecture
145+
docker buildx build --platform linux/amd64 -f rasa.Dockerfile -t <yourdockerhubId>/rasa-chatbot-backend:latest .
146+
```
147+
148+
- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.
149+
150+
- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`
151+
152+
> [!primary]
153+
>
154+
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
155+
>
156+
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **<yourdockerhubId>/rasa-chatbot-backend:latest**.
157+
>
158+
159+
#### Push the image
160+
161+
Run the following command:
137162

138163
```bash
139-
docker build . -f rasa.Dockerfile -t <yourdockerhubId>/rasa-chatbot-backend:latest
140164
docker push <yourdockerhubId>/rasa-chatbot-backend:latest
141165
```
142166

167+
#### Deploy the app
168+
143169
Now that your container is created, let's run our application and deploy our model!
144170

145171
```console
@@ -200,10 +226,19 @@ EXPOSE 5000
200226
CMD python3 app.py
201227
```
202228

203-
Let's now run the app on AI Deploy! To do so, you will need to create a Docker image. Go into the `front-end` folder (`ai-training-examples/apps/flask/conversational-rasa-chatbot/front-end`) and run:
229+
Let's now run the app on AI Deploy! To do so, you will need to create a Docker image. Go into the `front-end` folder (`ai-training-examples/apps/flask/conversational-rasa-chatbot/front-end`) and run one of the following commands:
204230

205-
```bash
231+
```console
232+
# Build the image using your machine's default architecture
206233
docker build . -f flask.Dockerfile -t <yourdockerhubId>/flask-app-frontend:latest
234+
235+
# Build image targeting the linux/amd64 architecture
236+
docker buildx build --platform linux/amd64 -f flask.Dockerfile -t <yourdockerhubId>/flask-app-frontend:latest .
237+
```
238+
239+
Then push your image:
240+
241+
```bash
207242
docker push <yourdockerhubId>/flask-app-frontend:latest
208243
```
209244

0 commit comments

Comments
 (0)