Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build update #220

Merged
merged 6 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
printf "%d args:" "$#"
printf " '%s'" "$@"
printf "\n"

"$@"
20 changes: 14 additions & 6 deletions .github/docker/include
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ layer_begin() {
cat /etc/ci-image-info
printf "\n"

echo apt update
echo Running: apt update
apt update || exit
printf "\n"

echo apt list --upgradable
echo Running: apt list --upgradable
apt list --upgradable || exit
printf "\n"

echo apt upgrade -y
echo Running: apt upgrade -y
apt upgrade -y || exit
printf "\n"

Expand All @@ -32,11 +32,19 @@ layer_begin() {
layer_end() {
printf "=== %s:%s start ===\n\n" "${0}" "layer_end()"

echo apt-get clean
apt-get clean || exit
echo Running: apt autoremove -y
apt autoremove -y || exit
printf "\n"

echo rm -rf /var/lib/apt/lists/*
echo Running: apt autoclean -y
apt autoclean -y || exit
printf "\n"

echo Running: apt-get clean -y
apt-get clean -y || exit
printf "\n"

echo Running: rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* || exit
printf "\n"

Expand Down
25 changes: 23 additions & 2 deletions .github/docker/layer-00.00-base-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
#!/bin/sh
#
# .github/docker/layer-00.00-base-dependencies.sh
#

# this path from for the container
# shellcheck disable=SC1091
. /.github/docker/include

main() {
layer_begin "$@"
layer_begin "${0}" "$@"

PACKAGES="apt-utils bash coreutils curl jq moreutils sudo tmux util-linux vim-nox"

printf "Collecting apt installed packages:\n"
echo Running: apt list --installed \> /root/apt-pkgs-start.txt
apt list --installed >/root/apt-pkgs-start.txt
printf "\n"

echo Running: apt remove -y "$(apt list --installed | grep -e xorg -e xserver -e qt | cut -f1 -d/)"
# shellcheck disable=SC2046
apt remove -y $(apt list --installed | grep -e xorg -e xserver -e qt | cut -f1 -d/) || exit
printf "\n"

echo Running: apt-get purge libx11.* libqt.*
apt-get purge libx11.* libqt.* || exit
printf "\n"

echo Running: apt-get remove -y x11-common
apt-get remove -y x11-common || exit
printf "\n"

echo apt install -y "${PACKAGES}"
# shellcheck disable=SC2086
apt install -y ${PACKAGES} || exit
printf "\n"

layer_end "$@"
layer_end "${0}" "$@"
}

main "${@}" 2>&1 | tee /root/layer-00.00-base-dependencies.log
7 changes: 5 additions & 2 deletions .github/docker/layer-00.10-base-daggerio.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
#
# .github/docker/layer-00.10-base-daggerio.sh
#

set -o pipefail

Expand All @@ -7,13 +10,13 @@ set -o pipefail
. /.github/docker/include

main() {
layer_begin "$@"
layer_begin "${0}" "$@"

echo curl -sSfL https://releases.dagger.io/dagger/install.sh \| sh
curl -sSfL https://releases.dagger.io/dagger/install.sh | sh || exit
printf "\n"

layer_end "$@"
layer_end "${0}" "$@"
}

main "${@}" |& tee /root/layer-00.10-base-daggerio.log
29 changes: 16 additions & 13 deletions .github/docker/layer-02.20-exercism-nodejs.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
#!/bin/bash
#
# .github/docker/layer-02.20-exercism-nodejs.sh
#

set -o pipefail

# this path from for the container
# shellcheck disable=SC1091
. /.github/docker/include

layer_begin "$@"
main() {
layer_begin "${0}" "$@"

declare -a PACKAGES
PACKAGES=(
nodejs
npm
)
declare -a PACKAGES
PACKAGES=(
nodejs
npm
)

declare -a MODULES
MODULES=(
json2yaml
yarn
)
declare -a MODULES
MODULES=(
json2yaml
yarn
)

main() {
apt update

echo apt install -y "${PACKAGES[@]}"
Expand All @@ -31,7 +34,7 @@ main() {
npm install --global "${MODULES[@]}" || exit
printf "\n"

layer_end "$@"
layer_end "${0}" "$@"
}

main "${@}" |& tee /root/layer-02.20-exercism-nodejs.log
85 changes: 44 additions & 41 deletions .github/docker/layer-10.00-exercism-gcc_clang_llvm.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
#
# .github/docker/layer-10.00-exercism-gcc_clang_llvm.sh
#

set -o pipefail

Expand All @@ -8,48 +11,48 @@ set -o pipefail
# shellcheck disable=SC1091
. /.github/docker/include

layer_begin "$@"
main() {
layer_begin "${0}" "$@"

declare -a PACKAGES
PACKAGES=(
build-essential
ccls
clangd-16
clang-16
clang-16-doc
clang-format-16
clang-tidy-16
clang-tools-16
cmake
gcc
gcovr
gettext
gnu-standards
g++
lcov
libboost-all-dev
libclang1-16
libclang-16-dev
libclang-common-16-dev
libclang-rt-16-dev
libc++abi-16-dev
libc++-16-dev
libfuzzer-16-dev
libllvm16
libllvm-16-ocaml-dev
libssl-dev
libunwind-16-dev
lldb-16
lld-16
llvm-16
llvm-16-dev
llvm-16-runtime
make
pkg-config
python3-clang-16
)
declare -a PACKAGES
PACKAGES=(
build-essential
ccls
clangd-16
clang-16
clang-16-doc
clang-format-16
clang-tidy-16
clang-tools-16
cmake
gcc
gcovr
gettext
gnu-standards
g++
lcov
libboost-all-dev
libclang1-16
libclang-16-dev
libclang-common-16-dev
libclang-rt-16-dev
libc++abi-16-dev
libc++-16-dev
libfuzzer-16-dev
libllvm16
libllvm-16-ocaml-dev
libssl-dev
libunwind-16-dev
lldb-16
lld-16
llvm-16
llvm-16-dev
llvm-16-runtime
make
pkg-config
python3-clang-16
)

main() {
# wget -q https://apt.llvm.org/llvm.sh
# chmod -v +x llvm.sh
# ./llvm.sh 16 all
Expand All @@ -76,7 +79,7 @@ EOF
apt install -y "${PACKAGES[@]}" || exit
printf "\n"

layer_end "$@"
layer_end "${0}" "$@"
}

main "${@}" |& tee /root/layer-10.00-exercism-gcc_clang_llvm.log
90 changes: 47 additions & 43 deletions .github/docker/layer-15.00-exercism-rust.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
#
# .github/docker/layer-15.00-exercism-rust.sh
#

set -o pipefail

Expand All @@ -8,49 +11,50 @@
# shellcheck disable=SC1091
. /.github/docker/include

layer_begin "$@"

declare -a PACKAGES
PACKAGES=(
clang-16
clang-tidy-16
clang-tools-16
cmake
g++
gcovr
lcov
libllvm-16-ocaml-dev
libllvm16
libssl-dev
lld-16
llvm-16
llvm-16-dev
llvm-16-doc
llvm-16-examples
llvm-16-runtime
)

declare -a CRATES
CRATES=(
cargo-audit
cargo-edit
cargo-fix
cargo-fuzz
cargo-kcov
cargo-llvm-cov
cargo-tarpaulin
grcov
zellij
)

declare -a COMPONENTS
COMPONENTS=(
clippy
llvm-tools-x86_64-unknown-linux-gnu
rustfmt
)

main() {
layer_begin "${0}" "$@"

declare -a PACKAGES
PACKAGES=(
clang-16
clang-tidy-16
clang-tools-16
cmake
g++
gcovr
lcov
libllvm-16-ocaml-dev
libllvm16
libssl-dev
lld-16
llvm-16
llvm-16-dev
llvm-16-doc
llvm-16-examples
llvm-16-runtime
)

declare -a CRATES
CRATES=(
cargo-audit
cargo-cache
cargo-edit
cargo-fix
cargo-fuzz
cargo-kcov
cargo-llvm-cov
cargo-tarpaulin
grcov
zellij
)

declare -a COMPONENTS
COMPONENTS=(
clippy
llvm-tools-x86_64-unknown-linux-gnu
rustfmt
)

echo Running: apt install -y "${PACKAGES[@]}"
time apt install -y "${PACKAGES[@]}" || exit
printf "\n"
Expand All @@ -61,7 +65,7 @@

# ENV PATH="/root/.cargo/bin:${PATH}"
printf "source %s\n" "${HOME}/.cargo/env" | tee -a "${HOME}/.bashrc"
source "${HOME}/.bashrc"

Check warning on line 68 in .github/docker/layer-15.00-exercism-rust.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] reported by reviewdog 🐶 Not following: ./.bashrc: openBinaryFile: does not exist (No such file or directory) [SC1091](https://github.com/koalaman/shellcheck/wiki/SC1091) Raw Output: ./.github/docker/layer-15.00-exercism-rust.sh:68:16:info:Not following: ./.bashrc: openBinaryFile: does not exist (No such file or directory) [SC1091](https://github.com/koalaman/shellcheck/wiki/SC1091)

echo Running: rustup default stable
time rustup default stable || exit
Expand Down Expand Up @@ -120,7 +124,7 @@
cargo cache --info
printf "\n"

layer_end "$@"
layer_end "${0}" "$@"
}

main "${@}" |& tee /root/layer-15.00-exercism-rust.log
Loading