While you are working with a Dockerfile, it's common that you want to rebuild the docker image, rerun the container with the new docker image and test quickly. Each time after you make a change in the Dockerfile, you will need to type the same commands to rebuild, rerun and test repeatedly.
By using TaskTips you can automate this process. Whenever you make a change, you can simply search and run this task, which will handle all the things automatically for you. Please see the example as below.
Example: Build and run custom milter docker
Build and run custom milter docker
cd $HOME/work/my-containers/custom-milter docker build -t tasktips/custom_milter:latest . docker stop my_milter docker rm my_milter docker run -d --name my_milter \ -p 25:25 -p 587:587 \ custom_milter:latest docker exec -it my_milter bash
Search Key: Empty
Safe Mode: Enabled
After you make changes in your Dockerfile, you can run this task which will do the following automatically:
- Rebuild the docker image
- Stop the running docker container
- Remove the old docker container
- Rerun a new docker container with new docker image
- Open bash of the new docker container in console
You can then continue your test with the new container from the current terminal. As you can see, to use TaskTips, you can do your tests very quickly.
It's common that you input same commands into your terminal again and again. The magic is that once you copy these commands and create a new task in TaskTips, you can simply search and execute this task automatically.