Dockerfiles
a primer...

Presented by

Scott Collier

System Engineer, Red Hat

Creative Common Attribution License
Today's Topics
1. Whoami
2. Introduction
3. Dockerfiles
4. Fedora Project
5. Where to go from here?
6. Demo
Introduction

3
Dockerfiles

Do you have to have them?
No.
What are they?
Containers / Images
Single Process Container
Multi-Process Container
How?

Host Container
Official / Trusted / Non-Trusted...
Dockerfiles

6
Dockerfiles
Command

Explanation

FROM

Sets which base image to use

ADD

Lets you add content to the image

CMD

Provide...
Dockerfile
# Version 1.0
FROM fedora
MAINTAINER scollier <scollier@redhat.com>
RUN yum -y update
RUN yum -y install mongod...
Dockerfiles
Building
docker build --help
--no-cache=true
Don't use cache

-q=true
Be quite!

-rm
Remove intermediate conta...
Dockerfiles
Time to Build, how can they be called?
Github
# docker build git://github.com/scollier/dockerfilesrabbitmq.git...
Fedora Project

11
Fedora Project
Where can you get some example Fedora
dockerfiles?
GitHub
https://github.com/scollier/Fedora-Dockerfiles
Fe...
Fedora Project, cont
What's there?
nginx, apache, couchdb, firefox, memcached, mongodb,
mysql, postgres, rabbitmq, ssh, wo...
Demo

14
Demo
Start from scratch!
Explore some Dockerfiles
Local Build of Single Process Container
Remote Build of Multi-Process Co...
Stay in Touch

colliernotes.com
@collier_s
Questions?

17
Creative Common Attribution License
Upcoming SlideShare
Loading in …5
×

Fedora docker

1,203 views
1,055 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,203
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Fedora docker

  1. 1. Dockerfiles a primer... Presented by Scott Collier System Engineer, Red Hat Creative Common Attribution License
  2. 2. Today's Topics 1. Whoami 2. Introduction 3. Dockerfiles 4. Fedora Project 5. Where to go from here? 6. Demo
  3. 3. Introduction 3
  4. 4. Dockerfiles Do you have to have them? No. What are they?
  5. 5. Containers / Images Single Process Container Multi-Process Container How? Host Container Official / Trusted / Non-Trusted Images
  6. 6. Dockerfiles 6
  7. 7. Dockerfiles Command Explanation FROM Sets which base image to use ADD Lets you add content to the image CMD Provides defaults for an executing container, can be used interchangeably with ENTRYPOINT ENTRYPOINT Sets the container up to behave like a single executable ENV Passes a variable to all future RUN instructions EXPOSE Exposes port(s) MAINTAINER Metadata about who owns this RUN Executing directive used to build an image USER Sets the UID to run the next command as VOLUME Enables access to a directory on the host machine WORKDIR Sets where CMD is executed from
  8. 8. Dockerfile # Version 1.0 FROM fedora MAINTAINER scollier <scollier@redhat.com> RUN yum -y update RUN yum -y install mongodb-server # Create a directory here for the MongoDB data store. RUN mkdir -p /data/db RUN sed -i 's/dbpath =/var/lib/mongodb/dbpath =/data/db/' /etc/mongodb.conf VOLUME ["/data/db"] EXPOSE 27017 ENTRYPOINT ["/usr/bin/mongod"]
  9. 9. Dockerfiles Building docker build --help --no-cache=true Don't use cache -q=true Be quite! -rm Remove intermediate containers after build -t Tag!
  10. 10. Dockerfiles Time to Build, how can they be called? Github # docker build git://github.com/scollier/dockerfilesrabbitmq.git Locally When in current directory # docker build . When located somewhere else # docker build - < /path/to/Dockerfile Trusted Builds Link between index.docker.io and your github account Code triggers a build
  11. 11. Fedora Project 11
  12. 12. Fedora Project Where can you get some example Fedora dockerfiles? GitHub https://github.com/scollier/Fedora-Dockerfiles Fedora Hosted https://git.fedorahosted.org/cgit/dockerfiles.git/ # yum -y install fedora-dockerfiles
  13. 13. Fedora Project, cont What's there? nginx, apache, couchdb, firefox, memcached, mongodb, mysql, postgres, rabbitmq, ssh, wordpress, more to come! Each example contains Dockerfile How to run How to test
  14. 14. Demo 14
  15. 15. Demo Start from scratch! Explore some Dockerfiles Local Build of Single Process Container Remote Build of Multi-Process Container
  16. 16. Stay in Touch colliernotes.com @collier_s
  17. 17. Questions? 17 Creative Common Attribution License

×