diff options
author | James Mills <1290234+prologic@users.noreply.github.com> | 2020-01-18 00:34:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-18 00:34:19 +0200 |
commit | 986bc2052c34b8cbb8ec46664b77cf2994df34c3 (patch) | |
tree | 47d8bb6340db61c11f4104788aca07cb443bd17e /packaging | |
parent | 6d4fa9f3c2b82dc961cfadf619df7189cdababbf (diff) |
Cleanup packaging/makeself/build-x86_64-static.sh to use /bin/sh and remove use of sudo (#7725)
Diffstat (limited to 'packaging')
-rwxr-xr-x | packaging/makeself/build-x86_64-static.sh | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/packaging/makeself/build-x86_64-static.sh b/packaging/makeself/build-x86_64-static.sh index 69ddf2bf54..cae4d4f6e3 100755 --- a/packaging/makeself/build-x86_64-static.sh +++ b/packaging/makeself/build-x86_64-static.sh @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/bin/sh + # SPDX-License-Identifier: GPL-3.0-or-later . $(dirname "$0")/../installer/functions.sh || exit 1 @@ -7,36 +8,34 @@ set -e DOCKER_CONTAINER_NAME="netdata-package-x86_64-static-alpine37" -if ! sudo docker inspect "${DOCKER_CONTAINER_NAME}" >/dev/null 2>&1 -then +if ! docker inspect "${DOCKER_CONTAINER_NAME}" >/dev/null 2>&1; then # To run interactively: - # sudo docker run -it netdata-package-x86_64-static /bin/sh + # docker run -it netdata-package-x86_64-static /bin/sh # (add -v host-dir:guest-dir:rw arguments to mount volumes) # # To remove images in order to re-create: - # sudo docker rm -v $(sudo docker ps -a -q -f status=exited) - # sudo docker rmi netdata-package-x86_64-static + # docker rm -v $(sudo docker ps -a -q -f status=exited) + # docker rmi netdata-package-x86_64-static # # This command maps the current directory to # /usr/src/netdata.git # inside the container and runs the script install-alpine-packages.sh # (also inside the container) # - run sudo docker run -v $(pwd):/usr/src/netdata.git:rw alpine:3.7 \ + run docker run -v $(pwd):/usr/src/netdata.git:rw alpine:3.7 \ /bin/sh /usr/src/netdata.git/packaging/makeself/install-alpine-packages.sh # save the changes made permanently - id=$(sudo docker ps -l -q) - run sudo docker commit ${id} "${DOCKER_CONTAINER_NAME}" + id=$(docker ps -l -q) + run docker commit ${id} "${DOCKER_CONTAINER_NAME}" fi # Run the build script inside the container -run sudo docker run -a stdin -a stdout -a stderr -i -t -v \ +run docker run -a stdin -a stdout -a stderr -i -t -v \ $(pwd):/usr/src/netdata.git:rw \ "${DOCKER_CONTAINER_NAME}" \ /bin/sh /usr/src/netdata.git/packaging/makeself/build.sh "${@}" -if [ "${USER}" ] - then - sudo chown -R "${USER}" . +if [ "${USER}" ]; then + chown -R "${USER}" . fi |