Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Using hook script and flattening dir structure.
Browse files Browse the repository at this point in the history
Learned this from
docker/hub-feedback#508 (comment)
and from https://github.com/git-lfs/build-dockers

No longer using wget since build.sh is on the same level as the
Dockerfile.
  • Loading branch information
Robpol86 committed Dec 30, 2016
1 parent 0f073d4 commit c274834
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 21 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM fedora:rawhide
# Dummy file to be replaced by post_checkout hook.
6 changes: 3 additions & 3 deletions centos/6/Dockerfile → centos6.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ MAINTAINER Robpol86 <robpol86@gmail.com>

RUN yum update -y && \
yum groupinstall -y "Development Tools" && \
yum install -y centos-packager rpmdevtools wget
yum install -y centos-packager rpmdevtools

VOLUME ["/RPMS", "/SRPMS", "/SOURCES", "/SPECS"]
ADD build.sh build.sh

RUN useradd rpm && \
su rpm -lc rpmdev-setuptree && \
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done' && \
wget https://raw.githubusercontent.com/Robpol86/dockerRPMbuild/${GIT_REF:-master}/build.sh
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done'

ENTRYPOINT ["bash", "build.sh"]
5 changes: 2 additions & 3 deletions centos/7/Dockerfile → centos7.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ MAINTAINER Robpol86 <robpol86@gmail.com>

RUN yum update -y && \
yum groupinstall -y "Development Tools" && \
yum install -y centos-packager rpmdevtools wget
yum install -y centos-packager rpmdevtools

VOLUME ["/RPMS", "/SRPMS", "/SOURCES", "/SPECS"]

RUN useradd rpm && \
su rpm -lc rpmdev-setuptree && \
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done' && \
wget https://raw.githubusercontent.com/Robpol86/dockerRPMbuild/${GIT_REF:-master}/build.sh
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done'

ENTRYPOINT ["bash", "build.sh"]
5 changes: 2 additions & 3 deletions fedora/22/Dockerfile → fedora22.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM fedora:22
MAINTAINER Robpol86 <robpol86@gmail.com>

RUN dnf update -y && \
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core wget
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core

VOLUME ["/RPMS", "/SRPMS", "/SOURCES", "/SPECS"]

RUN useradd rpm && \
su rpm -lc rpmdev-setuptree && \
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done' && \
wget https://raw.githubusercontent.com/Robpol86/dockerRPMbuild/${GIT_REF:-master}/build.sh
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done'

ENTRYPOINT ["bash", "build.sh"]
5 changes: 2 additions & 3 deletions fedora/23/Dockerfile → fedora23.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM fedora:23
MAINTAINER Robpol86 <robpol86@gmail.com>

RUN dnf update -y && \
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core wget
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core

VOLUME ["/RPMS", "/SRPMS", "/SOURCES", "/SPECS"]

RUN useradd rpm && \
su rpm -lc rpmdev-setuptree && \
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done' && \
wget https://raw.githubusercontent.com/Robpol86/dockerRPMbuild/${GIT_REF:-master}/build.sh
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done'

ENTRYPOINT ["bash", "build.sh"]
5 changes: 2 additions & 3 deletions fedora/24/Dockerfile → fedora24.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM fedora:24
MAINTAINER Robpol86 <robpol86@gmail.com>

RUN dnf update -y && \
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core wget
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core

VOLUME ["/RPMS", "/SRPMS", "/SOURCES", "/SPECS"]

RUN useradd rpm && \
su rpm -lc rpmdev-setuptree && \
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done' && \
wget https://raw.githubusercontent.com/Robpol86/dockerRPMbuild/${GIT_REF:-master}/build.sh
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done'

ENTRYPOINT ["bash", "build.sh"]
5 changes: 2 additions & 3 deletions fedora/25/Dockerfile → fedora25.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM fedora:25
MAINTAINER Robpol86 <robpol86@gmail.com>

RUN dnf update -y && \
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core wget
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core

VOLUME ["/RPMS", "/SRPMS", "/SOURCES", "/SPECS"]

RUN useradd rpm && \
su rpm -lc rpmdev-setuptree && \
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done' && \
wget https://raw.githubusercontent.com/Robpol86/dockerRPMbuild/${GIT_REF:-master}/build.sh
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done'

ENTRYPOINT ["bash", "build.sh"]
5 changes: 2 additions & 3 deletions fedora/rawhide/Dockerfile → fedoraRawhide.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM fedora:rawhide
MAINTAINER Robpol86 <robpol86@gmail.com>

RUN dnf update -y && \
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core wget
dnf install -y @development-tools fedora-packager rpmdevtools dnf-plugins-core

VOLUME ["/RPMS", "/SRPMS", "/SOURCES", "/SPECS"]

RUN useradd rpm && \
su rpm -lc rpmdev-setuptree && \
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done' && \
wget https://raw.githubusercontent.com/Robpol86/dockerRPMbuild/${GIT_REF:-master}/build.sh
su rpm -lc 'for d in RPMS SRPMS SOURCES SPECS; do rmdir rpmbuild/$d; ln -s /$d $_; done'

ENTRYPOINT ["bash", "build.sh"]
9 changes: 9 additions & 0 deletions hooks/post_checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e # Exit script if a command fails.
set -o pipefail # Exit script if any piped program fails instead of just the last program.
set -u # Treat unset variables as errors and exit immediately.
set -x # Print commands run by script to standard out.

printenv
cp ${DOCKER_TAG}.Dockerfile Dockerfile

0 comments on commit c274834

Please sign in to comment.