Optimizing an Image using Golang (less than 2MB)
docker pull fabiolnh/docker_desafio_go:latest
- Starting a MySQL Database creating a Database and a Table with a "init" file
- A Node Application that connects to the Database, inserts a value into the table and prints it on the browser
- NgInx as a reverse proxy server using the 8080 port redirecting to the node application (Port 3000 inside the Docker network)
- ENTRYPOINT VS CMD:
Dockerfile: CMD sleep 5
$ docker run test sleep 10
Command at startup: sleep 10
Dockerfile ENTRYPOINT ["sleep"]
$ docker run test 10
Command at startup: sleep 10
Dockerfile ENTRYPOINT ["sleep"] CMD ["5"]
$ docker run test
Command at startup: sleep 5
$ docker run test 10
Command at startup: sleep 10
OBS: You can override the entrypoint in the docker run command:
$ docker run --entrypoint sleep2 test 10
Command at startup: sleep2 10