# Ambari - Docker Imagem
###### tags: `ambari` `docker`
## Dockerfile
```dockerfile=
FROM quay.io/footloose/ubuntu18.04
LABEL manteiner="Roberto Rodrigues Junior <robertogyn19@gmail.com>"
RUN apt update
RUN DEBIAN_FRONTEND="noninteractive" apt install -y nano net-tools iputils-ping vim ntp
RUN update-rc.d ntp defaults
RUN wget -O /etc/apt/sources.list.d/ambari.list http://public-repo-1.hortonworks.com/ambari/ubuntu18/2.x/updates/2.7.4.0/ambari.list
RUN apt install -y gnupg2
RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
RUN apt update
RUN apt install -y ambari-agent
RUN mkdir -p /root/.vim
RUN echo "set nocompatible" >> /root/.vim/vimrc
RUN echo "set nu!" >> /root/.vim/vimrc
RUN echo "set paste!" >> /root/.vim/vimrc
```
## Build da imagem
```shell=
docker build -t <nome da imagem>:<tag> -f Dockerfile .
```
## Iniciar a imagem
```shell=
docker run --name <nome do container> \
--network host \
--hostname <fqdn> \
--privileged \
--volume <diretório local>:/data \
-dit <nome da imagem>:<tag>
```
O parâmetro `--hostname` acima não é necessário caso sua rede já tenha um DNS configurado. Essa configuração é necessária para o Ambari conectar aos agentes.