Top docker images that I tend to use ad-hoc
Tags: docker
Published: 2019-01-31 02:42:41

---
title: Top docker images that I tend to use ad-hoc
published: true
description: A collection of Docker images that I run ad-hoc
tags: docker
cover_image: https://sinpapel.es/labinabox/img/dockerrescue.png
---

Docker is a great tool for building and shipping Software. Many teams around the world are taking advantages of its features. For Development, it is particularly useful to be able to declare your whole stack in a `docker-compose.yml` file and bringing it up and down with all the dependencies and packages that it needs to run.

I tend to use Docker a lot, not only as part of a project but also to perform several ad-hoc tasks. The primary benefit for me is that I don't have to bother installing and then removing the required software - a Docker image is all that's needed to spin-up a container! Here's the top list of Docker images that I tend to use ad-hoc.

1.Adminer

<img src="http://manuelcesarini.it/wp-content/uploads/2017/05/adminer-logo.jpg">
Adminer (formerly phpMinAdmin) is a full-featured database management tool written in PHP. It comes very handily when you need to access an external Database and having a UI will be of help.

Docker command: ```sh
docker run -d -p 8080:8080 adminer
```

Explanation: 
```
-p 8080:8080 = link the host port 8080 with the container port 8080.
-d = run on detached mode.
```

2.Nginx

<img src="https://www.logolynx.com/images/logolynx/61/61c738af9de36116116271f3003c9f07.png">

Nginx is a high-performance Web server and the go-to solution for multiple companies around the world. If you've ever had to configure it then you may appreciate being able to do it in your machine, rather than having to connect to the host where it is running.

Docker command: ```sh
docker run -it -p 80:80 -v $(pwd):/usr/share/nginx/html nginx bash
```

Explanation: 
```
-p 80:80 = link the host port 80 with the container port 80.
-it = It is actually combining two flags, -i (interactive) and -t (allocate a tty).
-v = mount in volumen. $(pwd) is the current working directory and /usr/share/nginx/html is the place inside the container where it will be mounted.
nginx bash = run bash inside nginx (Inside the container you can run nginx commands as much as you want).
```

3.Ansible

<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSAUWECBfidOSKEcRqfj_EYKCCd7oTnSIvgETsE0QGXZNajCRwi">

Ansible is an automation tool for apps and IT infrastructure. It is like Chef and Puppet. You tell Ansible how to connect to the host and define how the host should be configured, and it will go to configure the host for you.

Docker command: ```sh
docker run -it -v $(pwd):/app ansible bash
```

Explanation: 
```
-it = It is actually combining two flags, -i (interactive) and -t (allocate a tty).
-v = mount in volumen. $(pwd) is the current working directory and /app is the place inside the container where it will be mounted.
ansible bash = run bash inside ansible (Inside the container you can run ansible commands as much as you want).
```

4.Sqlite3

<img src="https://cdn-images-1.medium.com/max/1200/1*fMPUMki182HzyVZvo_awDw.png">

SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine. The data can be stored either on a single file in the disk or in-memory.

I've been using sqlite3 a lot lately to interact with a Python webscrapper that have the data in an SQLite file. The CLI and the instructions could get better, but definitively does the job!

Docker command: ```sh
docker run -it -v $(pwd):/root/db --entrypoint bash nouchka/sqlite3
```

Explanation: 
```
-it = It is actually combining two flags, -i (interactive) and -t (allocate a tty).
-v = mount in volumen. $(pwd) is the current working directory and /root/db is the place inside the container where it will be mounted.
--entrypoint = sets the entrypoint command of the container. In this case, the entrypoint will be Bash.
```

Notes about the docker run commands:
* You can add `--rm` and it will remove the container as soon as it stops.

These are the ones that I tend to use nowadays. Of course, I also use ad-hoc images when I'm learning something (latest were Python3 and Elixir/Phoenix) or under other circumstances (checking if I'm ready for Node V10 or giving maintenance to an old PHP5.4 app).

Of course, if you're running an ad-hoc container a lot for one specific project, you may want to consider using `docker-compose` instead.

Do you usead-hoc images in your day-to-day? Which ones?