A docker image for interactive use, with more utilities?
Often when looking at new software, I like to install it in a docker container and try it out before I commit to either
- Writing a proper Dockerfile for it, or
- Trying it out on my host
So I open up a brand new container using docker run --rm -it debian bash
and then I find myself installing a bunch of basic utilities like wget
and doing apt-updates.
I figure that this might be a common use case. Are there any docker images which are suited for this, before I decide to roll out my own?
Solution 1:
I recommend you to create your own image with all configurations you want. The process is create your folder images configurations:
mkdir myimage
The create your Dockerfile with the following command:
vi myimage/Dockerfile`
Add this into your file:
#Your comments about
FROM ubuntu:16.04
LABEL author="William Ventura [email protected]"
RUN apt-get update; apt-get install -y wget
#RUN apt-get install -y package1 package2
#EXPOSE 80
Then you have have to create your own image with your configurations you did in the Dockerfile
with the following command:
docker build -f myimage/Dockerfile -t user/myimage .
And it is going to build your own image where you will have installed all the packages you defined in the file.
The you will be able to create containers as you usually do:
docker exec -it --name myimage user/myimage bash
Finally you will have myimage
with the tools built-in.