I'm trying to learn how to write a Dockerfile. Currently my strategy is as follows:
- Guess what commands are correct to write based documentation.
- Run
sudo docker-compose up --build -d
to build a docker container - Wait ~5 minutes for my anaconda packages to install
- Find that I made a mistake on step 15, and go back to step 1.
Is there a way to interactively enter the commands for a Dockerfile, or to cache the first 14 successful steps so I don't need to rebuild the entire file? I saw something about docker exec
but it seems that's only for running containers. I also want to try and use the same syntax as I use in the dockerfile (i.e. ENTRYPOINT and ENV) since I'm not sure what the bash equivalent is/if it exists.