2021-05-19 04:36:09 +02:00
|
|
|
ARG GOLANG
|
|
|
|
FROM ${GOLANG}
|
|
|
|
|
|
|
|
ARG SPECTRAL_VERSION
|
2024-09-26 09:11:11 +02:00
|
|
|
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
|
2021-05-19 04:36:09 +02:00
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/spectral"]
|
|
|
|
CMD ["--version"]
|