Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
Fix rootfs build process to be more portable
Browse files Browse the repository at this point in the history
[#89744426]
  • Loading branch information
luan authored and Luan Santos committed Mar 6, 2015
1 parent 6b1e520 commit 5586ddc
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 14 deletions.
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
all: cflinuxfs2.tar.gz lucid64.tar.gz


cflinuxfs2.cid: cflinuxfs2/Dockerfile
docker build --no-cache -t cloudfoundry/cflinuxfs2 cflinuxfs2
docker run --cidfile=cflinuxfs2.cid cloudfoundry/cflinuxfs2 dpkg -l | tee cflinuxfs2/cflinuxfs2_dpkg_l.out

cflinuxfs2.tar: cflinuxfs2.cid
docker export `cat cflinuxfs2.cid` > cflinuxfs2.tar
docker export `cat cflinuxfs2.cid` > /tmp/cflinuxfs2.tar
# Always remove the cid file in order to grab updated package versions.
rm cflinuxfs2.cid

cflinuxfs2.tar.gz: cflinuxfs2.tar
tar -C cflinuxfs2/assets -f cflinuxfs2.tar -r etc/hosts etc/timezone
gzip -f cflinuxfs2.tar
./bin/make_tarball.sh cflinuxfs2

lucid64.cid: lucid64/Dockerfile
docker build --no-cache -t cloudfoundry/lucid64 lucid64
docker run --cidfile=lucid64.cid cloudfoundry/lucid64 dpkg -l | tee lucid64/lucid64_dpkg_l.out

lucid64.tar: lucid64.cid
docker export `cat lucid64.cid` > lucid64.tar
docker export `cat lucid64.cid` > /tmp/lucid64.tar
# Always remove the cid file in order to grab updated package versions.
rm lucid64.cid

lucid64.tar.gz: lucid64.tar
tar -C lucid64/assets -f lucid64.tar -r etc/hosts etc/timezone
gzip -f lucid64.tar
./bin/make_tarball.sh lucid64
17 changes: 17 additions & 0 deletions bin/make_tarball.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

make_tarball="
mkdir -p /tmp/$1/etc
cp $1/assets/etc/hosts /tmp/$1/etc/hosts
cp $1/assets/etc/timezone /tmp/$1/etc/timezone
tar -C /tmp/$1 -xf /tmp/${1}.tar
ls /tmp/$1/ | xargs tar -C /tmp/$1 -czf ${1}.tar.gz
rm -rf /tmp/$1
"

if [ "$(uname)" == "Darwin" ]; then
sudo bash -c "$make_tarball"
sudo chmod a+rw ${1}.tar.gz
else
bash -c "$make_tarball"
fi
2 changes: 2 additions & 0 deletions cflinuxfs2/build/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,5 @@ apt_get dist-upgrade
apt_get install $packages_copied_from_lucid_script $packages_from_lucid_debootstrap $packages_copied_from_diego_trusty_script ubuntu-minimal

apt-get clean

rm -rf /usr/share/doc/* /usr/share/man/* /usr/share/groff/* /usr/share/info/* /usr/share/lintian/* /usr/share/linda/*
3 changes: 2 additions & 1 deletion cflinuxfs2/build/install-ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fi
git clone git://github.com/sstephenson/ruby-build.git /tmp/ruby-build
pushd /tmp/ruby-build
PREFIX=/usr/local ./install.sh
/usr/local/bin/ruby-build $RUBY_VERSION /usr
RUBY_CONFIGURE_OPTS=--disable-install-doc \
/usr/local/bin/ruby-build $RUBY_VERSION /usr
popd
rm -rf /tmp/ruby-build*
8 changes: 4 additions & 4 deletions cflinuxfs2/cflinuxfs2_receipt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Rootfs SHASUM: 46e3eb31e76b7fc11db31cf4e2f0a1039a8d05f9 cflinuxfs2/rootfs.tgz
Docker Image: 72a99d2dbb84
S3 ETag: b2ffd6edbdabdeed81bacfb47f54a9e0
Rootfs SHASUM: 4b21db5f9cb1dc97ecf481c15ea1e89408c42833 cflinuxfs2.tar.gz
Docker Image: 350078f1ed5f
S3 ETag: ddbed958103d2c98e7b299624bac5eee

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
Expand Down Expand Up @@ -444,7 +444,7 @@ ii libxt6:amd64 1:1.1.4-1 amd6
ii libxvidcore4:amd64 2:1.3.2-9ubuntu1 amd64 Open source MPEG-4 video codec (library)
ii libyaml-0-2:amd64 0.1.4-3ubuntu3.1 amd64 Fast YAML 1.1 parser and emitter library
ii libyaml-dev:amd64 0.1.4-3ubuntu3.1 amd64 Fast YAML 1.1 parser and emitter library (development)
ii linux-libc-dev:amd64 3.13.0-46.75 amd64 Linux Kernel Headers for development
ii linux-libc-dev:amd64 3.13.0-46.77 amd64 Linux Kernel Headers for development
ii locales 2.13+git20120306-12.1 all common files for locale support
ii lockfile-progs 0.1.17 amd64 Programs for locking and unlocking files and mailboxes
ii login 1:4.1.5.1-1ubuntu9 amd64 system login tools
Expand Down
6 changes: 4 additions & 2 deletions lucid64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ubuntu:lucid

RUN mkdir -p /tmp

ADD build /tmp/build
ADD assets /tmp/assets

Expand All @@ -8,13 +10,13 @@ RUN bash /tmp/build/install-packages.sh
RUN bash /tmp/build/install-ruby.sh 1.9.3-p547
RUN bash /tmp/build/configure-core-dump-directory.sh
RUN bash /tmp/build/configure-firstboot.sh
RUN bash \
RUN bash -c '\
cd /tmp; \
wget http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz; \
tar -zxvf yaml-0.1.6.tar.gz; \
cd yaml-0.1.6; \
./configure; \
make; \
make install
make install'

RUN rm -rf /tmp/*
2 changes: 2 additions & 0 deletions lucid64/build/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,5 @@ apt_get dist-upgrade
apt_get install $packages_copied_from_lucid_script $packages_from_debootstrap

apt-get clean

rm -rf /usr/share/doc/* /usr/share/man/* /usr/share/groff/* /usr/share/info/* /usr/share/lintian/* /usr/share/linda/*
4 changes: 3 additions & 1 deletion lucid64/build/install-ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ if [ -z "$RUBY_VERSION" ]; then
exit 1
fi


git clone git://github.com/sstephenson/ruby-build.git /tmp/ruby-build
pushd /tmp/ruby-build
PREFIX=/usr/local ./install.sh
/usr/local/bin/ruby-build $RUBY_VERSION /usr
RUBY_CONFIGURE_OPTS=--disable-install-doc \
/usr/local/bin/ruby-build $RUBY_VERSION /usr
popd
rm -rf /tmp/ruby-build*

0 comments on commit 5586ddc

Please sign in to comment.