Conversation
| WORKDIR /app | ||
|
|
||
| # Copy the local binary into the container | ||
| COPY ./deweb-server_linux_amd64 /app/deweb-server_linux_amd64 |
There was a problem hiding this comment.
I'm unsure we should do that
IMO, we should divide this dockerfile into 2 stages, one to build and the other to run the image, so we don't require the host computer to have already built the binary
There was a problem hiding this comment.
Yes, that's a good solution; it's called a multi-stage build, which we discussed last week.
Another option is to place the binary directly into the image (as done here) and tag the image based on the binary (built by a CI or a third party).
Ex : deweb_server:1.0.0 contains the version 1.0.0 of deweb ... and user choose different version of the docker image based on the deweb server. (And pass a config file if needed).
But yeah let me work on multi stage build if u want
| # Expose the port on which the server listens (optional, if needed) | ||
| EXPOSE 8080 |
There was a problem hiding this comment.
Users might want to use a specific DeWeb server configuration and so, use a different port, is that something that can be handled ? Or should users using docker change the exposed port another way than the DeWeb server config file ?
There was a problem hiding this comment.
That's why docker is so cool.
EXPOSE here say, IN the docker container we want to expose the port 8080 (because i know my software use this port), OTHER ports can't be acceded.
user can choose to use any port on their host machine ( ex with -p option)
ex user want to run deweb_server on port 5000 :
docker run -p 5000:8080 deweb_server
No description provided.