the first line tells docker to use the ubuntu 16.04 image as a baseline to build the image
think of the dockerfile as a recipe on how to setup a machine
If I understand correctly this file is not generic and would likely need to be modified before use
unless the default FROM matches the user's intended base. Or is this a hint by the dev (me) that this
is the image I used and is the recommended image?
Edit: I'm asking in the context of including it in the package. Does it belong there or is it someting
specific to each user?
it is generic
what happens when someone builds the image (or even better: you setup automatic builds with docker hub):
- docker will run a leightwight container, which runs the ubuntu 16.04 tools and programs using the host kernel (thus its way faster than VMs as most of the overhead is saved), this step is called the "FROM", it defines a baseline image to be used for this image
- docker will install the neccessary tools to build and run cpuminer-opt defined with the "RUN" command, which will execute them inside this ubuntu container
- docker will then build cpuminer-opt and install it in the containers system paths
- docker will then set the entrypoint to the bin, so every command you append to your docker commandline will get passed to cpuminer-opt bin
- docker will then remove all build deps and execute autoremove for anything else that might be unneeded
- "CMD" tells docker to pass that command if nothing else is supplied by the user when running the docker image later
after this procedure you end up with a docker image where you just run
docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [ARG...]
though for docker hub i would change the git pull stuff to just plain "COPY" and remove the apt-get remove steps as the space savings are marginal, additionally id update the build.sh to use nprocs and just use that (no static linking)
everyone can then use this single image, its not specific to one user/system
one problem might exist: currently cpuminer-opt determines cpu capabilities at build time, not runtime, so every system *might* need to rebuild the image for their cpu if it differs from the initially building one
in general docker is used for application delivery, but cpuminer-opt is special because it relies on cpu features at build time