Skip to content

Instantly share code, notes, and snippets.

@pweil-
Created April 3, 2017 14:57
Show Gist options
  • Save pweil-/14ffec3ea2ad628ab894b4b49ee38787 to your computer and use it in GitHub Desktop.
Save pweil-/14ffec3ea2ad628ab894b4b49ee38787 to your computer and use it in GitHub Desktop.
[pweil@localhost origin]$ cat foo.tar | docker run -i -e BUILD_LOGLEVEL=5 --cap-drop KILL --cap-drop MKNOD --cap-drop SETGID --cap-drop SETUID --cap-drop SYS_CHROOT centos/ruby-22-centos7:latest /bin/sh -c "tar -C /tmp -xf - && /usr/libexec/s2i/assemble"---> Installing application source ...
---> Building your Ruby application from source ...
---> Running 'bundle install --deployment --without development:test' ...
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/...............
Installing puma 3.4.0
Installing rack 1.6.4
Using bundler 1.7.8
Your bundle is complete!
Gems in the groups development and test were not installed.
It was installed into ./bundle
current dir is /opt/app-root/src
contents of bundle:
total 0
drwxr-xr-x. 3 root root 18 Apr 3 14:54 .
drwxrwxr-x. 6 default root 128 Apr 3 14:54 ..
drwxr-xr-x. 9 root root 111 Apr 3 14:54 ruby
---> Cleaning up unused ruby gems ...
contents of bundle:
total 0
drwxr-xr-x. 3 root root 18 Apr 3 14:54 .
drwxrwxr-x. 6 default root 128 Apr 3 14:54 ..
drwxr-xr-x. 9 root root 111 Apr 3 14:54 ruby
fixing permissions
changing permissions on ./tmp
changing permissions on ./db
end of script - contents of /opt/app-root/src are:
total 52
-rw-r--r--. 1 1000 1000 52 Mar 22 17:15 Gemfile
-rw-r--r--. 1 1000 1000 149 Mar 22 17:15 Gemfile.lock
-rw-r--r--. 1 1000 1000 3183 Mar 22 17:15 README.md
drwxr-xr-x. 3 root root 18 Apr 3 14:54 bundle
-rwxr-xr-x. 1 1000 1000 39929 Mar 22 17:15 config.ru
[pweil@localhost origin]$ docker commit 5c63a978c73f pweil/manual-build
sha256:d149e50d574c3745e588e84c97f56e7c1d01aa8e9a57054120fa43483599ba61
[pweil@localhost origin]$ docker run -it pweil/manual-build /bin/bash
bash-4.2# ls -l /opt/app-root/src
total 52
-rw-r--r--. 1 1000 1000 52 Mar 22 17:15 Gemfile
-rw-r--r--. 1 1000 1000 149 Mar 22 17:15 Gemfile.lock
-rw-r--r--. 1 1000 1000 3183 Mar 22 17:15 README.md
drwxr-xr-x. 3 root root 18 Apr 3 14:54 bundle
-rwxr-xr-x. 1 1000 1000 39929 Mar 22 17:15 config.ru
[pweil@localhost origin]$ cat foo.tar | docker run --userns=host -i -e BUILD_LOGLEVEL=5 --cap-drop KILL --cap-drop MKNOD --cap-drop SETGID --cap-drop SETUID --cap-drop SYS_CHROOT centos/ruby-22-centos7:latest /bin/sh -c "tar -C /tmp -xf - && /usr/libexec/s2i/assemble"
---> Installing application source ...
---> Building your Ruby application from source ...
---> Running 'bundle install --deployment --without development:test' ...
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/...............
Installing puma 3.4.0
Installing rack 1.6.4
Using bundler 1.7.8
Your bundle is complete!
Gems in the groups development and test were not installed.
It was installed into ./bundle
current dir is /opt/app-root/src
contents of bundle:
total 0
drwxr-xr-x. 3 root root 18 Apr 3 14:56 .
drwxrwxr-x. 6 2329225 root 128 Apr 3 14:56 ..
drwxr-xr-x. 9 root root 111 Apr 3 14:56 ruby
---> Cleaning up unused ruby gems ...
contents of bundle:
total 0
drwxr-xr-x. 3 root root 18 Apr 3 14:56 .
drwxrwxr-x. 6 2329225 root 128 Apr 3 14:56 ..
drwxr-xr-x. 9 root root 111 Apr 3 14:56 ruby
fixing permissions
changing permissions on ./tmp
changing permissions on ./db
end of script - contents of /opt/app-root/src are:
total 52
-rw-r--r--. 1 1000 1000 52 Mar 22 17:15 Gemfile
-rw-r--r--. 1 1000 1000 149 Mar 22 17:15 Gemfile.lock
-rw-r--r--. 1 1000 1000 3183 Mar 22 17:15 README.md
drwxr-xr-x. 3 root root 18 Apr 3 14:56 bundle
-rwxr-xr-x. 1 1000 1000 39929 Mar 22 17:15 config.ru
[pweil@localhost origin]$ docker commit 522d89808873 pweil/manual-build
sha256:662d2fc1b3e337417139a103d08604f22212cf45294d66857bfcff2bbf4493ed
[pweil@localhost origin]$ docker run -it pweil/manual-build /bin/bash
bash-4.2# ls -l /opt/app-root/src
total 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment