harbor/tools/spectral/Dockerfile
Vadim Bauer d42c34786f
Make it possible to build the spectral image also on ARM (#20506)
* This makes changes makes it possible to build the spectral image also on ARM architecture.

* no message

Signed-off-by: Vadim Bauer <vb@container-registry.com>

* fix issue

Signed-off-by: Vadim Bauer <vb@container-registry.com>

---------

Signed-off-by: Vadim Bauer <vb@container-registry.com>
2024-09-26 07:11:11 +00:00

18 lines
566 B
Docker

ARG GOLANG
FROM ${GOLANG}
ARG SPECTRAL_VERSION
RUN case "$(dpkg --print-architecture)" in \
amd64) ARCH="x64" ;; \
arm64) ARCH="arm64" ;; \
*) echo "Unsupported architecture" && exit 1 ;; \
esac && \
echo "Architecture: $ARCH" && \
echo "Spectral version: $SPECTRAL_VERSION" && \
URL="https://github.com/stoplightio/spectral/releases/download/$SPECTRAL_VERSION/spectral-linux-$ARCH" && \
echo "URL: $URL" && \
curl -fsSL -o /usr/bin/spectral $URL && chmod +x /usr/bin/spectral
ENTRYPOINT ["/usr/bin/spectral"]
CMD ["--version"]