File tree 4 files changed +29
-11
lines changed
4 files changed +29
-11
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- tar -C / -xf -
3
+ cd $HOME
4
+
5
+ exec tar -xzf -
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- tar -cf - /opt/ruby/bundle
3
+ cd $HOME
4
+
5
+ # List the files and directories you would like to archive.
6
+ #
7
+ exec tar -czf - {bundle,gems}
Original file line number Diff line number Diff line change @@ -11,11 +11,14 @@ source ${HOME}/etc/helpers
11
11
# If the /tmp/src is empty, then print usage and exit.
12
12
(dir_is_empty /tmp/src) && print_usage_and_exit
13
13
14
- # Detect presence of $stdin and restore the artifacts
14
+ # Detect the presence of $stdin and restore the artifacts
15
+ # To restore the artifacts, you have to run the builder as:
16
+ #
17
+ # docker run -v $(pwd):/tmp/src openshift/centos-ruby-builder < artifacts.tgz
15
18
#
16
19
if [ -p /dev/stdin ]; then
17
- echo " ---> Restoring artifacts from STDIN "
18
- cat | /opt/ruby /bin/restore-artifacts
20
+ echo " ---> Restoring artifacts"
21
+ cat | ${HOME} /bin/restore-artifacts
19
22
fi
20
23
21
24
# Build the ruby application first
@@ -24,5 +27,6 @@ ${HOME}/bin/prepare
24
27
25
28
# Replace this script with the application runner at the end of the build.
26
29
#
27
- echo " ---> Build successful. Commit this image with: docker commit ${HOSTNAME} ruby-app"
30
+ echo " ---> Build successful. Commit this image with: 'docker commit ${HOSTNAME} ruby-app'"
31
+
28
32
cp -f ${HOME} /bin/run ${HOME} /bin/start && exit
Original file line number Diff line number Diff line change 3
3
4
4
function print_usage_and_exit() {
5
5
echo
6
- echo "This image can build your Ruby source code ."
7
- echo "To build from a git repo, run this in your checked out repo :"
6
+ echo "This is the Ruby/Rails self-contained builder image ."
7
+ echo "You can use this to produce application images :"
8
8
echo
9
- echo " docker run -v \$(pwd):/tmp/src openshift/centos-ruby-builder"
9
+ echo " $ docker run -v \$(pwd):/tmp/src openshift/centos-ruby-builder"
10
10
echo
11
- echo "Options:"
11
+ echo "You can also archive artifacts from the current application image:"
12
+ echo
13
+ echo " $ docker run --entrypoint='${HOME}/bin/save-artifacts' ruby-app > archive.tgz"
14
+ echo
15
+ echo "And restore the artifacts on the next build:"
16
+ echo
17
+ echo " $ docker run -v \$(pwd):/tmp/src openshift/centos-ruby-builder < archive.tgz"
18
+ echo
19
+ echo "Other options:"
12
20
echo
13
21
echo " --debug Drop to the shell instead of build."
14
22
echo
15
- exit
23
+ exit 0
16
24
}
You can’t perform that action at this time.
0 commit comments