diff --git a/Dockerfile b/Dockerfile index 145fa52..e79549a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,19 @@ -FROM ubuntu:22.04 +FROM ubuntu:26.04@sha256:f3d28607ddd78734bb7f71f117f3c6706c666b8b76cbff7c9ff6e5718d46ff64 -# Ubuntu 22.04 ships with: -# - bash version "5.1.16(1)-release" -# APT installs: -# - bats v1.2.1 -# - ruby v3.0.2p107 -# - jq v"jq-1.6" -# Install latest shellcheck from its github releases -# - as of 2023-04-25, that is v0.9.0 +# Bats 1.13.0 +# GNU bash, version 5.3.9(1)-release (x86_64-pc-linux-gnu) +# jq-1.8.1 +# ruby 3.3.8 (2025-04-09 revision b200bad6cd) [x86_64-linux-gnu] +# ShellCheck version: 0.11.0 RUN apt-get update && \ - apt-get install -y bats ruby jq wget && \ + apt-get install --yes --no-install-recommends ca-certificates bats ruby jq wget xz-utils && \ apt-get purge --auto-remove && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ - wget -q https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz && \ - tar Jxf ./shellcheck-stable.linux.x86_64.tar.xz && \ - cp ./shellcheck-stable/shellcheck /usr/local/bin && \ - rm -r ./shellcheck-stable.linux.x86_64.tar.xz ./shellcheck-stable/ && \ - shellcheck --version + wget -q https://github.com/koalaman/shellcheck/releases/download/v0.11.0/shellcheck-v0.11.0.linux.x86_64.tar.xz -O- \ + | tar -J --extract shellcheck-v0.11.0/shellcheck --to-stdout > /usr/local/bin/shellcheck && \ + chmod 755 /usr/local/bin/shellcheck RUN mkdir /opt/analyzer COPY . /opt/analyzer diff --git a/bin/versions.sh b/bin/versions.sh new file mode 100755 index 0000000..d363a61 --- /dev/null +++ b/bin/versions.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +# Build the Docker image +docker build --rm -t exercism/bash-analyzer . + +# Print tool versions inside Docker +docker run --rm -it --entrypoint /bin/bash exercism/bash-analyzer -c 'for i in bats bash jq ruby; do "$i" --version | head -n1; done; shellcheck --version | head -n2'