Skip to content

Commit

Permalink
create /.dockerenv in a $BUILD_ROOT
Browse files Browse the repository at this point in the history
Sometimes we need to distinguish if we running build in a container.
/.dockerenv is a file exists in all images. Let's pretend we run a
propper image

Signed-off-by: Dinar Valeev <k0da@opensuse.org>
  • Loading branch information
k0da committed Jun 15, 2016
1 parent 751c6c5 commit d1fea38
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions build-vm-docker
Expand Up @@ -29,6 +29,7 @@ vm_verify_options_docker() {

vm_startup_docker() {
local name="obsbuild.${BUILD_ROOT##*/}"
touch $BUILD_ROOT/.dockerenv
docker rm "$name" >/dev/null 2>&1 || true
docker run \
--rm --name "$name" --cap-add=sys_admin --net=none \
Expand Down

0 comments on commit d1fea38

Please sign in to comment.