Skip to content

Instantly share code, notes, and snippets.

@initcron
Created September 13, 2018 09:03
Show Gist options
  • Save initcron/4c6ce311762f6e82a394d38d244d3f86 to your computer and use it in GitHub Desktop.
Save initcron/4c6ce311762f6e82a394d38d244d3f86 to your computer and use it in GitHub Desktop.
Instruction to build docker image for facebooc using Dockerfile

Building image with Dockerfile

Change into facebooc directory which containts the source code. This assumes you have already cloned the repo. If not, clone it from https://github.com/schoolofdevops/facebooc

cd facebooc 
ls

LICENSE  Makefile  README.md  include  src  static  templates

Add/create Dockerfile the the same directory (facebooc) witht the following content,

FROM  ubuntu


WORKDIR /opt/facebooc

RUN  apt-get update &&  \
     apt-get install -yq build-essential make git libsqlite3-dev sqlite3 


COPY . /opt/facebooc

RUN  make all 

EXPOSE 16000

CMD "bin/facebooc"

Build image using,

 docker build -t <docker_id>/facebooc:v2 .

where, <docker_id> : your docker registry user/namespace. Replace this with the actual user

validate

docker image ls
docker image history <docker_id>/facebooc:v2
docker container run -idt -P <docker_id>/facebooc:v2
docker ps 

Check by connecting to your host:port to validate if facebooc web application shows up.

Once validated, tag and push

docker image tag <docker_id>/facebooc:v2 <docker_id>/facebooc:latest
docker login
docker push <docker_id>/facebooc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment