Skip to content

Commit 9780655

Browse files
bhouse-nexthoplguohan
authored andcommitted
Dockerfile.j2 slave should include optional vendor-specific file
There are instances where a vendor may want to add additional packages to the slave docker that aren't suitable for upstreaming such as necessary applications or packages for secureboot signing unique to the vendor environment. This allows vendors to define their own `sonic-slave-Dockerfile.vendor.j2` file within the toplevel files folder if they want to use this feature. Since these are things that would never be upstreamed, it eases the maintenance burden of handling merge conflicts as well as should be automatically updated when new slave containers are defined (e.g. bookworm -> trixie). This follows the precident where a vendor may define their own config settings in rules/config.user. Signed-off-by: Brad House <[email protected]>
1 parent ff937d3 commit 9780655

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

sonic-slave-bookworm/Dockerfile.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,3 +781,8 @@ ENV PATH $PATH:$RUST_ROOT/bin
781781

782782
# Install cargo-tarpaulin for code coverage
783783
RUN $RUST_ROOT/bin/cargo install --locked cargo-tarpaulin
784+
785+
{# Include vendor-defined rules for slave container if it exists. Contained in ../files #}
786+
{% with DEBIAN_VERSION='bookworm' %}
787+
{% include 'files/sonic-slave-Dockerfile.vendor.j2' ignore missing %}
788+
{% endwith %}

sonic-slave-bullseye/Dockerfile.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,3 +721,8 @@ RUN mkdir -p /.cargo && $RUST_ROOT/bin/rustup target add aarch64-unknown-linux-g
721721
{% endif -%}
722722
ENV RUSTUP_HOME $RUST_ROOT
723723
ENV PATH $PATH:$RUST_ROOT/bin
724+
725+
{# Include vendor-defined rules for slave container if it exists. Contained in ../files #}
726+
{% with DEBIAN_VERSION='bullseye' %}
727+
{% include 'files/sonic-slave-Dockerfile.vendor.j2' ignore missing %}
728+
{% endwith %}

sonic-slave-buster/Dockerfile.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,3 +687,8 @@ RUN mkdir -p /.cargo && $RUST_ROOT/bin/rustup target add aarch64-unknown-linux-g
687687
{% endif -%}
688688
ENV RUSTUP_HOME $RUST_ROOT
689689
ENV PATH $PATH:$RUST_ROOT/bin
690+
691+
{# Include vendor-defined rules for slave container if it exists. Contained in ../files #}
692+
{% with DEBIAN_VERSION='buster' %}
693+
{% include 'files/sonic-slave-Dockerfile.vendor.j2' ignore missing %}
694+
{% endwith %}

sonic-slave-jessie/Dockerfile.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,8 @@ RUN python -m pip install git+https://github.com/aristanetworks/swi-tools.git@d5
363363
ARG bazelisk_url=https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-{{ CONFIGURED_ARCH }}
364364
RUN curl -fsSL -o /usr/local/bin/bazel ${bazelisk_url} && chmod 755 /usr/local/bin/bazel
365365
{% endif -%}
366+
367+
{# Include vendor-defined rules for slave container if it exists. Contained in ../files #}
368+
{% with DEBIAN_VERSION='jessie' %}
369+
{% include 'files/sonic-slave-Dockerfile.vendor.j2' ignore missing %}
370+
{% endwith %}

sonic-slave-stretch/Dockerfile.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,3 +437,8 @@ LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node"
437437
ARG bazelisk_url=https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-{{ CONFIGURED_ARCH }}
438438
RUN curl -fsSL -o /usr/local/bin/bazel ${bazelisk_url} && chmod 755 /usr/local/bin/bazel
439439
{% endif -%}
440+
441+
{# Include vendor-defined rules for slave container if it exists. Contained in ../files #}
442+
{% with DEBIAN_VERSION='stretch' %}
443+
{% include 'files/sonic-slave-Dockerfile.vendor.j2' ignore missing %}
444+
{% endwith %}

sonic-slave-trixie/Dockerfile.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,3 +770,8 @@ RUN mkdir -p /.cargo && $RUST_ROOT/bin/rustup target add aarch64-unknown-linux-g
770770
{% endif -%}
771771
ENV RUSTUP_HOME=$RUST_ROOT
772772
ENV PATH=$PATH:$RUST_ROOT/bin
773+
774+
{# Include vendor-defined rules for slave container if it exists. Contained in ../files #}
775+
{% with DEBIAN_VERSION='trixie' %}
776+
{% include 'files/sonic-slave-Dockerfile.vendor.j2' ignore missing %}
777+
{% endwith %}

0 commit comments

Comments
 (0)