Skip to content

Instantly share code, notes, and snippets.

@javierpena
Last active May 17, 2017 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javierpena/f4e52b7c39c022f831d1f5bbc339cabe to your computer and use it in GitHub Desktop.
Save javierpena/f4e52b7c39c022f831d1f5bbc339cabe to your computer and use it in GitHub Desktop.
Create a Docker container based on a repo from RDO Trunk
1. Create a Dockerfile with the following contents:
FROM centos:7
LABEL maintainer=jpena name=DLRN-current
# Install Apache and rsync
RUN yum -y install httpd rsync && yum clean all
# Sync trunk.rdo contents
RUN rsync -avL trunk.rdoproject.org::centos7/current/ /var/www/html/repos
# Run command when container is started
CMD /usr/sbin/httpd $OPTIONS -DFOREGROUND
2. Build the container image
$ docker build -t dlrn/current:$(date --utc "+%Y%m%d%H%M%S") .
Using a date for the tag allows you to create multiple builds.
Note: rsync access is not enabled for all, we need to allow it case by case.
3. Run it
$ docker run -p 8080:80 dlrn/current:20170517104848
4. Now, you can create a .repo file pointing to http://localhost:8080/repos, which will use the RDO Trunk repo you synced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment