mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 06:59:39 +08:00
Add multi-architecture Docker image build
* Adds a shell script with functions to install multi-architecture docker support, as well as build, deploy, and test the shellcheck docker images for the same set of architectures for which binaries were already built and deployed as tarballs. * Hooks up the multi-architecture docker build, deploy, and test to the existing Travis CI/CD pipeline. It is organized as a separate stage which only runs if all previous steps in the already existing test stage succeed.
This commit is contained in:
26
Dockerfile.multi-arch
Normal file
26
Dockerfile.multi-arch
Normal file
@@ -0,0 +1,26 @@
|
||||
# Alpine image
|
||||
FROM alpine:latest AS alpine
|
||||
LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
|
||||
ARG tag
|
||||
|
||||
# Put the right binary for each architecture into place for the
|
||||
# multi-architecture docker image.
|
||||
RUN set -x; \
|
||||
arch="$(uname -m)"; \
|
||||
echo "arch is $arch"; \
|
||||
if [ "${arch}" = 'armv7l' ]; then \
|
||||
arch='armv6hf'; \
|
||||
fi; \
|
||||
url_base='https://shellcheck.storage.googleapis.com/'; \
|
||||
tar_file="shellcheck-${tag}.linux.${arch}.tar.xz"; \
|
||||
wget "${url_base}${tar_file}" -O - | tar xJf -; \
|
||||
mv "shellcheck-${tag}/shellcheck" /bin/; \
|
||||
rm -rf "shellcheck-${tag}"; \
|
||||
ls -laF /bin/shellcheck
|
||||
|
||||
# ShellCheck image
|
||||
FROM scratch
|
||||
LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
|
||||
WORKDIR /mnt
|
||||
COPY --from=alpine /bin/shellcheck /bin/
|
||||
ENTRYPOINT ["/bin/shellcheck"]
|
Reference in New Issue
Block a user