linuxserver / docker-smokeping

GNU General Public License v3.0
347 stars 95 forks source link

Smokeping version call depends on curl, install it first #111

Closed tcrichton closed 2 years ago

tcrichton commented 3 years ago

Dockerfile grabs the smokeping version in alpine's repo using curl but it isn't installed yet.

linuxserver.io



Description:

Altered the Dockerfiles to install curl before it is called (to acquire smokeping version from alpine's repo)

Benefits of this PR and context:

To allow a build to succeed

How Has This Been Tested?

Built the image successfully

docker build \
  --no-cache \
  --pull \
  -t ghcr.io/linuxserver/smokeping:latest

Before the change:

Step 8/11 : RUN  echo "**** install packages ****" &&  if [ -z ${SMOKEPING_VERSION+x} ]; then   SMOKEPING_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp     && awk '/^P:smokeping$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://');  fi &&  apk add --no-cache    apache2     apache2-ctl     apache2-utils   apache-mod-fcgid    bc  bind-tools  curl    font-noto-cjk   openssh-client  smokeping==${SMOKEPING_VERSION}     ssmtp   sudo    tcptraceroute   ttf-dejavu &&  echo "**** give setuid access to traceroute & tcptraceroute ****" &&  chmod a+s /usr/bin/traceroute &&  chmod a+s /usr/bin/tcptraceroute &&  echo "**** fix path to cropper.js ****" &&  sed -i 's#src="/cropper/#/src="cropper/#' /etc/smokeping/basepage.html &&  echo "**** install tcping script ****" &&  install -m755 -D /defaults/tcpping /usr/bin/ &&  echo "**** remove default apache conf ****" &&  rm -f /etc/apache2/httpd.conf
 ---> Running in 163da1268694
**** install packages ****
/bin/sh: curl: not found
tar: invalid magic
tar: short read
The command '/bin/sh -c echo "**** install packages ****" &&  if [ -z ${SMOKEPING_VERSION+x} ]; then    SMOKEPING_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp     && awk '/^P:smokeping$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://');  fi &&  apk add --no-cache    apache2     apache2-ctl     apache2-utils   apache-mod-fcgid    bc  bind-tools  curl    font-noto-cjk   openssh-client  smokeping==${SMOKEPING_VERSION}     ssmtp   sudo    tcptraceroute   ttf-dejavu &&  echo "**** give setuid access to traceroute & tcptraceroute ****" &&  chmod a+s /usr/bin/traceroute &&  chmod a+s /usr/bin/tcptraceroute &&  echo "**** fix path to cropper.js ****" &&  sed -i 's#src="/cropper/#/src="cropper/#' /etc/smokeping/basepage.html &&  echo "**** install tcping script ****" &&  install -m755 -D /defaults/tcpping /usr/bin/ &&  echo "**** remove default apache conf ****" &&  rm -f /etc/apache2/httpd.conf' returned a non-zero code: 1

After:

Step 8/11 : RUN  echo "**** install packages ****" &&  apk add --no-cache   curl &&  if [ -z ${SMOKEPING_VERSION+x} ]; then     SMOKEPING_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp     && awk '/^P:smokeping$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://');  fi &&  apk add --no-cache    apache2     apache2-ctl     apache2-utils   apache-mod-fcgid    bc  bind-tools  font-noto-cjk   openssh-client  smokeping==${SMOKEPING_VERSION}     ssmtp   sudo    tcptraceroute   ttf-dejavu &&  echo "**** give setuid access to traceroute & tcptraceroute ****" &&  chmod a+s /usr/bin/traceroute &&  chmod a+s /usr/bin/tcptraceroute &&  echo "**** fix path to cropper.js ****" &&  sed -i 's#src="/cropper/#/src="cropper/#' /etc/smokeping/basepage.html &&  echo "**** install tcping script ****" &&  install -m755 -D /defaults/tcpping /usr/bin/ &&  echo "**** remove default apache conf ****" &&  rm -f /etc/apache2/httpd.conf
 ---> Running in 507d35f32589
**** install packages ****
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
(1/4) Installing brotli-libs (1.0.9-r3)
(2/4) Installing nghttp2-libs (1.42.0-r1)
(3/4) Installing libcurl (7.74.0-r1)
(4/4) Installing curl (7.74.0-r1)
Executing busybox-1.32.1-r3.trigger
OK: 19 MiB in 37 packages
LinuxServer-CI commented 3 years ago

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/smokeping/2.7.3-r5-pkg-77d18cf8-pr-111/index.html https://ci-tests.linuxserver.io/lspipepr/smokeping/2.7.3-r5-pkg-77d18cf8-pr-111/shellcheck-result.xml

github-actions[bot] commented 3 years ago

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

tcrichton commented 3 years ago

Seems good to merge unless I'm missing something.

github-actions[bot] commented 3 years ago

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.