-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (32 loc) · 1.59 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM centos:7
LABEL [email protected]
RUN yum install curl tar util-linux-ng epel-release ca-certificates -y
RUN yum install fakeroot iproute -y
## Prepare for Chef
RUN mkdir /root/chefrepo
ADD files/Cheffile /root/chefrepo/Cheffile
WORKDIR /root/chefrepo
## Create Omnibus Environment and Seppuku.
## (Delete chef to reduce image size.)
RUN eval "$(curl https://omnitruck.chef.io/install.sh)" && \
/opt/chef/embedded/bin/gem install librarian-chef -N && \
/opt/chef/embedded/bin/librarian-chef install && \
chef-client --chef-license accept -z -o "omnibus::default" && \
rm -rf /opt/chef /root/chefrepo /root/.chef /root/.ccache /usr/local/src/*
## Preinstall gems
WORKDIR /root
ADD files/Gemfile /root/Gemfile
ADD files/prebundle.sh /root/prebundle.sh
RUN ./prebundle.sh
ADD files/bash_with_env.sh /home/omnibus/bash_with_env.sh
ADD files/build.sh /home/omnibus/build.sh
ENV HOME /home/omnibus
## ONBUILD to build project
ONBUILD ADD . /home/omnibus/omnibus-project
WORKDIR /home/omnibus/omnibus-project
ONBUILD RUN bash -c 'source /home/omnibus/load-omnibus-toolchain.sh ; gem install bundler -N'
ONBUILD RUN bash -c 'source /home/omnibus/load-omnibus-toolchain.sh ; bundle config set without "development test"'
ONBUILD RUN bash -c 'source /home/omnibus/load-omnibus-toolchain.sh ; bundle install'
ONBUILD RUN bash -c 'source /home/omnibus/load-omnibus-toolchain.sh ; bundle binstubs --all --path bundle_bin'
ONBUILD RUN echo "Usage: docker run -it -e OMNIBUS_PROJECT=${PROJECT_NAME} -v pkg:/home/omnibus/omnibus-project/pkg builder-centos7"
CMD ["/home/omnibus/build.sh"]