update Go to 1.18 and Docker image to focal

This commit is contained in:
Kyle 2022-03-18 10:04:51 -07:00
parent b5897900cb
commit 11cca676b8
2 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
FROM ubuntu:18.04 as builder FROM ubuntu:20.04 as builder
MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com> MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com>
ARG TEST ARG TEST
@ -12,30 +12,30 @@ RUN apt-get update && \
apt-get install -y apt-transport-https build-essential git curl wget apt-get install -y apt-transport-https build-essential git curl wget
RUN wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add - RUN wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
RUN echo "deb https://download.ceph.com/debian-nautilus bionic main" >> /etc/apt/sources.list RUN echo "deb https://download.ceph.com/debian-nautilus focal main" >> /etc/apt/sources.list
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --force-yes librados-dev librbd-dev apt-get install -y --force-yes librados-dev librbd-dev
RUN \ RUN \
mkdir -p /goroot && \ mkdir -p /goroot && \
curl https://storage.googleapis.com/golang/go1.16.3.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1 curl https://storage.googleapis.com/golang/go1.18.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1
ADD . $APPLOC ADD . $APPLOC
WORKDIR $APPLOC WORKDIR $APPLOC
RUN go get -d RUN go get -d
# The `-tags nautilus` instructs go-ceph to enable additional support nautilus release. # The `-tags pacific` instructs go-ceph to enable additional support nautilus release.
# See https://github.com/ceph/go-ceph#installation # See https://github.com/ceph/go-ceph#installation
RUN if [ -n "${TEST}" ]; then go test -tags nautilus -v -race -count=1 ./...; fi RUN if [ -n "${TEST}" ]; then go test -tags pacific -v -race -count=1 ./...; fi
RUN go build -tags nautilus -o /bin/ceph_exporter RUN go build -tags pacific -o /bin/ceph_exporter
FROM ubuntu:18.04 FROM ubuntu:20.04
MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com> MAINTAINER Vaibhav Bhembre <vaibhav@digitalocean.com>
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y apt-transport-https curl wget gnupg apt-get install -y apt-transport-https curl wget gnupg
RUN wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add - RUN wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
RUN echo "deb https://download.ceph.com/debian-nautilus bionic main" >> /etc/apt/sources.list && \ RUN echo "deb https://download.ceph.com/debian-nautilus focal main" >> /etc/apt/sources.list && \
apt-get update && \ apt-get update && \
apt-get install -y --force-yes librados2 librbd1 ceph-common && \ apt-get install -y --force-yes librados2 librbd1 ceph-common && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/digitalocean/ceph_exporter module github.com/digitalocean/ceph_exporter
go 1.17 go 1.18
require ( require (
github.com/Jeffail/gabs v1.4.0 github.com/Jeffail/gabs v1.4.0