mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 02:05:41 +01:00
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>
This commit is contained in:
parent
cb7fef1840
commit
d42c34786f
2
Makefile
2
Makefile
@ -282,7 +282,7 @@ endef
|
|||||||
|
|
||||||
# lint swagger doc
|
# lint swagger doc
|
||||||
SPECTRAL_IMAGENAME=$(IMAGENAMESPACE)/spectral
|
SPECTRAL_IMAGENAME=$(IMAGENAMESPACE)/spectral
|
||||||
SPECTRAL_VERSION=v6.1.0
|
SPECTRAL_VERSION=v6.11.1
|
||||||
SPECTRAL_IMAGE_BUILD_CMD=${DOCKERBUILD} -f ${TOOLSPATH}/spectral/Dockerfile --build-arg GOLANG=${GOBUILDIMAGE} --build-arg SPECTRAL_VERSION=${SPECTRAL_VERSION} -t ${SPECTRAL_IMAGENAME}:$(SPECTRAL_VERSION) .
|
SPECTRAL_IMAGE_BUILD_CMD=${DOCKERBUILD} -f ${TOOLSPATH}/spectral/Dockerfile --build-arg GOLANG=${GOBUILDIMAGE} --build-arg SPECTRAL_VERSION=${SPECTRAL_VERSION} -t ${SPECTRAL_IMAGENAME}:$(SPECTRAL_VERSION) .
|
||||||
SPECTRAL=$(RUNCONTAINER) $(SPECTRAL_IMAGENAME):$(SPECTRAL_VERSION)
|
SPECTRAL=$(RUNCONTAINER) $(SPECTRAL_IMAGENAME):$(SPECTRAL_VERSION)
|
||||||
|
|
||||||
|
@ -2,7 +2,16 @@ ARG GOLANG
|
|||||||
FROM ${GOLANG}
|
FROM ${GOLANG}
|
||||||
|
|
||||||
ARG SPECTRAL_VERSION
|
ARG SPECTRAL_VERSION
|
||||||
RUN curl -fsSL -o /usr/bin/spectral https://github.com/stoplightio/spectral/releases/download/$SPECTRAL_VERSION/spectral-linux && chmod +x /usr/bin/spectral
|
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"]
|
ENTRYPOINT ["/usr/bin/spectral"]
|
||||||
CMD ["--version"]
|
CMD ["--version"]
|
||||||
|
Loading…
Reference in New Issue
Block a user