Skip to content

Commit

Permalink
Merge pull request #3172 from reubenmiller/dev-container-dep
Browse files Browse the repository at this point in the history
dev: update packages in dev container image
  • Loading branch information
reubenmiller authored Oct 8, 2024
2 parents 463655e + 181e2bd commit cfb537d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
40 changes: 30 additions & 10 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,56 @@ FROM mcr.microsoft.com/devcontainers/rust:1-${VARIANT}
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
# apt dependencies
apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \
apt-transport-https ca-certificates gnupg-agent software-properties-common lsb-release \
# Debian packaging utilities
equivs \
dpkg-dev \
fakeroot \
# Utilities
ssh \
sudo \
gnupg2 \
curl \
wget \
vim \
bash-completion \
netcat-openbsd \
iputils-ping \
net-tools \
# Enable systemd
systemd \
systemd-sysv \
dbus \
# Testing dependencies
docker \
python3 \
python3-pip \
python3-venv
python3-venv \
nginx \
# JSON tools
jq \
jo

# tedge dependencies
# Install more recent version of mosquitto >= 2.0.18 from debian sid to avoid mosquitto following bugs:
# Install more recent version of mosquitto >= 2.0.18 from debian backports to avoid mosquitto following bugs:
# The mosquitto repo can't be used as it does not included builds for arm64/aarch64 (only amd64 and armhf)
# * https://github.com/eclipse/mosquitto/issues/2604 (2.0.11)
# * https://github.com/eclipse/mosquitto/issues/2634 (2.0.15)
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian sid main' > /etc/apt/sources.list.d/debian-sid.list" \
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian bookworm-backports main' > /etc/apt/sources.list.d/debian-bookworm-backports.list" \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -t bookworm-backports \
mosquitto \
mosquitto-clients \
# Remove sid afterwards to prevent unexpected packages from being installed
&& rm -f /etc/apt/sources.list.d/debian-sid.list \
&& apt-get update
mosquitto-clients

# Remove unnecessary systemd services
RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/local-fs.target.wants/* \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/systemd-update-utmp* \
# Remove policy-rc.d file which prevents services from starting
&& rm -f /usr/sbin/policy-rc.d

# Install gh utility
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
Expand All @@ -58,7 +78,7 @@ RUN mkdir -p /etc/apt/keyrings \
&& apt-get install -y docker-ce-cli docker-compose-plugin

# Node js (for browser based tests and documentation using docusaurus)
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g yarn

Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"mutantdino.resourcemonitor",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"serayuzgur.crates",
"fill-labs.dependi",
"usernamehw.errorlens",
"streetsidesoftware.code-spell-checker",
// Shell script validation
Expand Down
4 changes: 4 additions & 0 deletions ci/build_scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ source ./ci/package_list.sh
# build release for target
# GIT_SEMVER should be referenced in the build.rs scripts
if [ "$BUILD" = 1 ]; then
# Install stable toolchain if missing
if command -V rustup >/dev/null 2>&1; then
rustup toolchain install stable --no-self-update
fi
# Use zig to build as it is provides better cross compiling support
cargo +stable install cargo-zigbuild --version ">=0.17.3"

Expand Down

0 comments on commit cfb537d

Please sign in to comment.