From 0d68e3525f75891a082540537559bee569293925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20A=C3=9Fmann?= Date: Wed, 1 Jun 2022 10:07:37 +0200 Subject: [PATCH 1/2] update base image We need to get roshi working on arm64 and amd64 platforms. Also doing a first upgrade of the image OS and golang version. --- README.md | 8 ++++++++ base/Dockerfile | 28 +++++++++------------------- roshi-server/Dockerfile | 3 ++- roshi-walker/Dockerfile | 3 ++- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index fcc5465..9eaf593 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,14 @@ curl "$(boot2docker ip):6060/metrics" The server image includes `EXPOSE 6302` (the default Roshi port), so container linking will work. +# Building a new image +in each folder run +``` +docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ello/roshi-base:latest . +docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ello/roshi-server:latest . +docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ello/roshi-walker:latest . +``` + # Roshi License View the [Roshi license information](https://github.com/soundcloud/roshi/blob/master/LICENSE.md). diff --git a/base/Dockerfile b/base/Dockerfile index fc86d67..c92f8a0 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu-debootstrap:latest +FROM golang:1.8.6-stretch # Add roshi user and group RUN groupadd --system roshi && \ @@ -9,31 +9,20 @@ RUN apt-get update && \ apt-get install -y curl git make && \ rm -rf /var/lib/apt/lists/* -# Install gosu -# https://github.com/tianon/gosu -RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 -RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.4/gosu-$(dpkg --print-architecture)" && \ - curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.4/gosu-$(dpkg --print-architecture).asc" && \ - gpg --verify /usr/local/bin/gosu.asc && \ - rm /usr/local/bin/gosu.asc && \ - chmod +x /usr/local/bin/gosu - -# Install Godeb -# https://github.com/niemeyer/godeb -RUN curl -Ss -o /tmp/godeb-amd64.tar.gz https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz && \ - tar -xvzf /tmp/godeb-amd64.tar.gz -C /usr/local/bin && \ - rm /tmp/godeb-amd64.tar.gz +RUN set -eux; \ + apt-get update; \ + apt-get install -y gosu ; \ +# verify that the binary works + gosu nobody true # Envs ENV ROSHI_COMMIT="4c3eb77eadb3a500ca14ac0578bd45bf5e640ddc" -ENV GO_VERSION="1.4.2" # Install Go, build roshi-server and roshi-walker, then delete Go -RUN godeb install ${GO_VERSION} && \ - export GOPATH=/go && export PATH=$PATH:${GOPATH}/bins && \ - mkdir -p ${GOPATH}/src/github.com/soundcloud && \ +RUN mkdir -p ${GOPATH}/src/github.com/soundcloud && \ git clone https://github.com/soundcloud/roshi.git ${GOPATH}/src/github.com/soundcloud/roshi && \ cd ${GOPATH}/src/github.com/soundcloud/roshi && git checkout ${ROSHI_COMMIT} && \ + # go mod init && go mod tidy cd roshi-server && make && mv roshi-server /usr/local/bin && \ cd ../roshi-walker && make && mv roshi-walker /usr/local/bin && \ cd / && \ @@ -43,4 +32,5 @@ RUN godeb install ${GO_VERSION} && \ # Entrypoint EXPOSE 6302 + ENTRYPOINT ["gosu", "roshi:roshi", "roshi-server"] diff --git a/roshi-server/Dockerfile b/roshi-server/Dockerfile index 897e89c..b6194de 100644 --- a/roshi-server/Dockerfile +++ b/roshi-server/Dockerfile @@ -1,4 +1,5 @@ -FROM ello/roshi-base:latest +#FROM ello/roshi-base:latest +FROM jovoto/roshi-base:1.8.6-stretch-arm64 # Entrypoint EXPOSE 6302 diff --git a/roshi-walker/Dockerfile b/roshi-walker/Dockerfile index 6a57b5c..3772d8c 100644 --- a/roshi-walker/Dockerfile +++ b/roshi-walker/Dockerfile @@ -1,4 +1,5 @@ -FROM ello/roshi-base:latest +#FROM ello/roshi-base:latest +FROM jovoto/roshi-base:1.8.6-stretch-arm64 # Entrypoint EXPOSE 6060 From d1238cf794b3abecc219b70d7f528d304b89a4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20A=C3=9Fmann?= Date: Wed, 1 Jun 2022 13:39:43 +0200 Subject: [PATCH 2/2] update to latest possible debian and golang version 1.15.15-buster & 1.16.15-bullseye fail with ../instrumentation/prometheus/prometheus.go:251:22: undefined: prometheus.Handler --- base/Dockerfile | 5 +++-- roshi-server/Dockerfile | 2 +- roshi-walker/Dockerfile | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index c92f8a0..1de5663 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,4 +1,5 @@ -FROM golang:1.8.6-stretch +# with later golang versions roshi fails to build ( 1.15.15-buster, 1.16.15-bullseye ) +FROM golang:1.14.15-buster # Add roshi user and group RUN groupadd --system roshi && \ @@ -22,7 +23,7 @@ ENV ROSHI_COMMIT="4c3eb77eadb3a500ca14ac0578bd45bf5e640ddc" RUN mkdir -p ${GOPATH}/src/github.com/soundcloud && \ git clone https://github.com/soundcloud/roshi.git ${GOPATH}/src/github.com/soundcloud/roshi && \ cd ${GOPATH}/src/github.com/soundcloud/roshi && git checkout ${ROSHI_COMMIT} && \ - # go mod init && go mod tidy + # go mod init && go mod tidy && \ cd roshi-server && make && mv roshi-server /usr/local/bin && \ cd ../roshi-walker && make && mv roshi-walker /usr/local/bin && \ cd / && \ diff --git a/roshi-server/Dockerfile b/roshi-server/Dockerfile index b6194de..a707313 100644 --- a/roshi-server/Dockerfile +++ b/roshi-server/Dockerfile @@ -1,5 +1,5 @@ #FROM ello/roshi-base:latest -FROM jovoto/roshi-base:1.8.6-stretch-arm64 +FROM jovoto/roshi-base-1.14.15-buster # Entrypoint EXPOSE 6302 diff --git a/roshi-walker/Dockerfile b/roshi-walker/Dockerfile index 3772d8c..0e5381a 100644 --- a/roshi-walker/Dockerfile +++ b/roshi-walker/Dockerfile @@ -1,5 +1,5 @@ #FROM ello/roshi-base:latest -FROM jovoto/roshi-base:1.8.6-stretch-arm64 +FROM jovoto/roshi-base-1.14.15-buster # Entrypoint EXPOSE 6060