FIWARE / tutorials.Custom-IoT-Agent

:orange_book: FIWARE 205: Creating a Custom IoT Agent
https://iotagent-node-lib.readthedocs.io/
MIT License
4 stars 3 forks source link

Fix undefined build arguments in Dockerfile #2

Closed fisuda closed 4 years ago

fisuda commented 4 years ago

This PR updates the iot-agent/Dockerfile file for fixing undefined build arguments.

$ docker build --build-arg IOTA_NORTH_PORT=8888 --build-arg IOTA_HTTP_PORT=9999 -t test .

Step 8/10 : EXPOSE ${IOTA_NORTH_PORT:-4041} ${IOTA_HTTP_PORT:-7896}
 ---> Using cache
 ---> f29db0b275fc
Step 9/10 : ENTRYPOINT ["docker/entrypoint.sh"]
 ---> Using cache
 ---> 51fe0e126ec4
Step 10/10 : CMD ["-- ", "config.js"]
 ---> Using cache
 ---> aa28dc4feb8c
[Warning] One or more build-args [IOTA_HTTP_PORT IOTA_NORTH_PORT] were not consumed
Successfully built aa28dc4feb8c
Successfully tagged test:latest

https://docs.docker.com/engine/reference/builder/#arg

The ARG instruction defines a variable that users can pass at build-time to the builder with the docker build command using the --build-arg = flag. If a user specifies a build argument that was not defined in the Dockerfile, the build outputs a warning.

[Warning] One or more build-args [foo] were not consumed.
$ docker build --build-arg IOTA_NORTH_PORT=8888 --build-arg IOTA_HTTP_PORT=9999 -t test .

Step 8/12 : ARG IOTA_NORTH_PORT
 ---> Running in e9fd6ec5648d
Removing intermediate container e9fd6ec5648d
 ---> 1e1207bf8f5d
Step 9/12 : ARG IOTA_HTTP_PORT
 ---> Running in 6944c9d2a5ea
Removing intermediate container 6944c9d2a5ea
 ---> 268dee1d7516
Step 10/12 : EXPOSE ${IOTA_NORTH_PORT:-4041} ${IOTA_HTTP_PORT:-7896}
 ---> Running in 9088b007b6d3
Removing intermediate container 9088b007b6d3
 ---> 90cfdd896a1d
Step 11/12 : ENTRYPOINT ["docker/entrypoint.sh"]
 ---> Running in d1454c0f7f36
Removing intermediate container d1454c0f7f36
 ---> db72f9f9f177
Step 12/12 : CMD ["-- ", "config.js"]
 ---> Running in 1038a95320b5
Removing intermediate container 1038a95320b5
 ---> 8d8e50517243
Successfully built 8d8e50517243
Successfully tagged test:latest