You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> As we're now doing the dependency install as part of the build, when you run `docker images` you'll notice our Docker image has increased in size.
261
263
>
262
264
> ```shell
263
-
> $ docker images
265
+
> $ docker images
264
266
> REPOSITORY TAG IMAGE ID CREATED SIZE
265
267
> your-lambda latest 05b92630088f 3 seconds ago 483MB
266
268
> public.ecr.aws/lambda/nodejs 24 30d41baede74 3 days ago 449MB
267
269
>```
268
270
269
271
> [!TIP]
270
272
> When running `docker images` you'll notice that we have got a dangling image that looks a bit like this:
271
-
>
273
+
>
272
274
> ```shell
273
-
> $ docker images
275
+
> $ docker images
274
276
> REPOSITORY TAG IMAGE ID CREATED SIZE
275
277
> your-lambda latest 05b92630088f 3 seconds ago 483MB
276
278
> public.ecr.aws/lambda/nodejs 24 30d41baede74 3 days ago 449MB
277
279
> <none> <none> 17e6c55f785f 3 days ago 449MB
278
280
> ```
279
281
>
280
282
> When you rebuilt the image, Docker moved the "nametag" to your new version, leaving the old version behind as a nameless orphan.
281
-
>
283
+
>
282
284
> Any dangling images can be cleaned with the following command:
283
-
>
285
+
>
284
286
> ```shell
285
287
> docker image prune
286
288
> ```
@@ -417,8 +419,8 @@ docker compose up --abort-on-container-exit
417
419
418
420
> [!NOTE]
419
421
> On this execution you'll see that the `curl` container received `Task timed out after 0.00 seconds`.
420
-
> Find the Lambda `REPORT` again and you'll see `Init Duration`, `Duration` and `Billed Duration` are all set to `0 ms`.
421
-
>
422
+
> Find the Lambda `REPORT` again and you'll see `Init Duration`, `Duration` and `Billed Duration` are all set to `0 ms`.
423
+
>
422
424
> **Be sure to set `AWS_LAMBDA_FUNCTION_TIMEOUT` back to `3` now.**
423
425
424
426
### Create the events subdirectory
@@ -570,7 +572,7 @@ docker compose up --abort-on-container-exit --build
570
572
> => CACHED [2/5] COPY ./package*.json /var/task
571
573
> => CACHED [3/5] RUN npm ci
572
574
> => [4/5] COPY ./ /var/task
573
-
> => [5/5] RUN npm run build
575
+
> => [5/5] RUN npm run build
574
576
> ```
575
577
576
578
### Multi-stage build
@@ -793,24 +795,50 @@ docker compose up --abort-on-container-exit --build
793
795
794
796
Since we are done with the workshop, let's remove the resources we created.
795
797
796
-
Run the following command to stop all services, remove the containers/networks, and delete all images used by this project (including the Node/Python base images, LocalStack, and the custom image we built):
798
+
Run the following command:
799
+
800
+
```shell
801
+
docker compose ps -a
802
+
```
803
+
804
+
> [!NOTE]
805
+
> Even though they're not running, we still have this images sitting there doing nothing.
806
+
807
+
Run the following command:
808
+
809
+
```shell
810
+
docker compose images
811
+
```
812
+
813
+
> [!NOTE]
814
+
> We also have these images which are taking up resources on our machine.
815
+
816
+
Run the following command to stop all services, remove the containers/networks, and delete all images used by this project (including cURL, LocalStack, and the custom image we built):
797
817
798
818
```shell
799
819
docker compose down --rmi all
800
820
```
801
821
822
+
> [!TIP]
823
+
> You will likely have a number of dangling images where we've made changes through out this workshop, run the following to clean them up:
824
+
>
825
+
> ```shell
826
+
> docker image prune
827
+
> ```
828
+
802
829
> [!WARNING]
803
830
> If you followed the prerequisites to run `docker load` this command will not actually remove all images, the `lambda/node` and `lambda/python` images still exist.
804
-
>
831
+
>
805
832
> To remove these you'll need to run the following:
0 commit comments