Skip to content

Instantly share code, notes, and snippets.

@xarg
Created February 27, 2016 16:07
Show Gist options
  • Save xarg/812c57d5a79d818d928f to your computer and use it in GitHub Desktop.
Save xarg/812c57d5a79d818d928f to your computer and use it in GitHub Desktop.
Rabbitmq Dockerfile
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'APT::Install-Recommends "0"; \n\
APT::Get::Assume-Yes "true"; \n\
APT::Get::force-yes "true"; \n\
APT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01buildconfig
# Add files.
COPY ./bin/rabbitmq.sh /usr/local/bin/
# Install RabbitMQ.
RUN \
apt-get install wget ca-certificates && \
wget -qO - https://www.rabbitmq.com/rabbitmq-signing-key-public.asc | apt-key add - && \
echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list && \
apt-get update && \
apt-get install rabbitmq-server && \
rm -rf /var/lib/apt/lists/*
RUN \
rabbitmq-plugins enable rabbitmq_management && \
echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config
# Define environment variables.
ENV RABBITMQ_LOG_BASE /data/log
ENV RABBITMQ_MNESIA_BASE /data/mnesia
# Define mount points.
VOLUME ["/data/log", "/data/mnesia"]
# Define working directory.
WORKDIR /data
# Define default command.
CMD ["/usr/local/bin/rabbitmq.sh"]
# Expose ports.
EXPOSE 5672
EXPOSE 15672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment