Below are the major steps on how to run a Debian package in Docker

Dockerfile
  • Download your Debian file

# Download .deb fileRUN wget $debian_url \
&& sudo dpkg -i appleapi.deb \
&& apt-get install -f

  • Using Ruby Tiller to overwrite environment specific configs (optional)

#Tiller
RUN sudo apt-get update && sudo apt-get -y install ruby
RUN gem install tiller

ADD deploy/tiller/*.yaml /etc/tiller/
ADD deploy/tiller/environments/dev /etc/tiller/environments/
ADD deploy/tiller/templates/* /etc/tiller/templates/

  • Run Tiller and tell it to use development environment configuration

RUN tiller -b /etc/tiller -n -v -e development

  • Expose the port of your app

EXPOSE 9001

  • Start your app via Supervisord (optional as you could just use CMD)

CMD [“/usr/bin/supervisord”]

  • Build the Docker file

docker build  -t appleapi .

  • Run Docker in localhost

docker run -p 9001:9001 appleapi

supervisord.conf

[supervisord]
nodaemon=true

[program:appleapi]
startsecs = 0
autorestart = false
command=/bin/bash -c “appleapi/bin/appleapi”