alpine linux apk installation error in Dockerfile

  alpine, dockerfile, installation, linux, package

I am trying to execute the following code in a Dockerfile:

    FROM alpine:3.7
RUN apk update && apk add --no-cache busybox musl prometheus-node-exporter
RUN rc-update add prometheus-node-exporter default
RUN rc-service prometheus-node-exporter start
RUN echo "  - job_name: node 
    # If prometheus-node-exporter is installed, grab stats about the local 
    # machine by default. 
    static_configs: 
      - targets: ['localhost:9100', 'alpine_distro:9100']" >> /etc/prometheus/prometheus.yml

but my build returns the following error:

    Step 1/5 : FROM alpine:3.7



 ---> 6d1ef012b567

Step 2/5 : RUN apk update && apk add --no-cache busybox musl prometheus-node-exporter



 ---> Running in 556de663c86e

fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz

fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz

v3.7.3-184-gffd32bfd09 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]

v3.7.3-183-gcc9ad2b48d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]

OK: 9054 distinct packages available

fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz

fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz

ERROR: 

unsatisfiable constraints:



  prometheus-node-exporter (missing):
    required by: world[prometheus-node-exporter]

The command '/bin/sh -c apk update && apk add --no-cache busybox musl prometheus-node-exporter' returned a non-zero code: 1

I am not used to alpine package manager but my guess is that I might not be using a repo that contains prometheus-node-exporter?

or am I missing something else?

Thanks

Source: Dockerfile Questions

LEAVE A COMMENT