build-x86_64-static.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-3.0-or-later
  3. . $(dirname "$0")/../installer/functions.sh || exit 1
  4. set -e
  5. DOCKER_CONTAINER_NAME="netdata-package-x86_64-static-alpine37"
  6. if ! docker inspect "${DOCKER_CONTAINER_NAME}" >/dev/null 2>&1; then
  7. # To run interactively:
  8. # docker run -it netdata-package-x86_64-static /bin/sh
  9. # (add -v host-dir:guest-dir:rw arguments to mount volumes)
  10. #
  11. # To remove images in order to re-create:
  12. # docker rm -v $(sudo docker ps -a -q -f status=exited)
  13. # docker rmi netdata-package-x86_64-static
  14. #
  15. # This command maps the current directory to
  16. # /usr/src/netdata.git
  17. # inside the container and runs the script install-alpine-packages.sh
  18. # (also inside the container)
  19. #
  20. run docker run -v $(pwd):/usr/src/netdata.git:rw alpine:3.7 \
  21. /bin/sh /usr/src/netdata.git/packaging/makeself/install-alpine-packages.sh
  22. # save the changes made permanently
  23. id=$(docker ps -l -q)
  24. run docker commit ${id} "${DOCKER_CONTAINER_NAME}"
  25. fi
  26. # Run the build script inside the container
  27. run docker run -a stdin -a stdout -a stderr -i -t -v \
  28. $(pwd):/usr/src/netdata.git:rw \
  29. "${DOCKER_CONTAINER_NAME}" \
  30. /bin/sh /usr/src/netdata.git/packaging/makeself/build.sh "${@}"
  31. if [ "${USER}" ]; then
  32. chown -R "${USER}" .
  33. fi