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

Fix docker build warnings when using buildx #2183

Merged
merged 1 commit into from
Sep 16, 2024
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: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG BASE_OS_IMAGE=registry.opensuse.org/opensuse/tumbleweed
ARG GO_VERSION=1.22

FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine as elemental-bin
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS elemental-bin

ENV CGO_ENABLED=0
WORKDIR /src/
Expand Down
12 changes: 6 additions & 6 deletions examples/blue/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# run `make build` to build local/elemental-toolkit image
ARG TOOLKIT_REPO
ARG VERSION
FROM ${TOOLKIT_REPO}:${VERSION} as TOOLKIT
ARG TOOLKIT_REPO=local/elemental-toolkit
ARG VERSION=latest
FROM ${TOOLKIT_REPO}:${VERSION} AS toolkit

# OS base image of our choice
FROM fedora:40 as OS
FROM fedora:40 AS os
ARG REPO
ARG VERSION
ENV VERSION=${VERSION}
Expand Down Expand Up @@ -51,7 +51,7 @@ RUN dnf install -y \
RUN mkdir -p /oem /system

# Just add the elemental cli
COPY --from=TOOLKIT /usr/bin/elemental /usr/bin/elemental
COPY --from=toolkit /usr/bin/elemental /usr/bin/elemental

# This is for automatic testing purposes, do not do this in production.
RUN echo "PermitRootLogin yes" > /etc/ssh/sshd_config.d/rootlogin.conf
Expand All @@ -70,4 +70,4 @@ RUN echo IMAGE_REPO=\"${REPO}\" >> /etc/os-release && \
echo GRUB_ENTRY_NAME=\"Elemental\" >> /etc/os-release

# Good for validation after the build
CMD /bin/bash
CMD ["/bin/bash"]
12 changes: 6 additions & 6 deletions examples/green/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# run `make build` to build local/elemental-toolkit image
ARG TOOLKIT_REPO
ARG VERSION
ARG TOOLKIT_REPO=local/elemental-toolkit
ARG VERSION=latest
ARG OS_IMAGE=registry.opensuse.org/opensuse/tumbleweed
ARG OS_VERSION=latest

FROM ${TOOLKIT_REPO}:${VERSION} AS TOOLKIT
FROM ${TOOLKIT_REPO}:${VERSION} AS toolkit

# OS base image of our choice
FROM ${OS_IMAGE}:${OS_VERSION} AS OS
FROM ${OS_IMAGE}:${OS_VERSION} AS os
ARG REPO
ARG VERSION
ENV REPO=${REPO}
Expand Down Expand Up @@ -68,7 +68,7 @@ RUN ARCH=$(uname -m); \
zypper clean --all

# Just add the elemental cli
COPY --from=TOOLKIT /usr/bin/elemental /usr/bin/elemental
COPY --from=toolkit /usr/bin/elemental /usr/bin/elemental

# Enable essential services
RUN systemctl enable NetworkManager.service && \
Expand All @@ -94,4 +94,4 @@ RUN echo IMAGE_REPO=\"${REPO}\" >> /etc/os-release && \
echo GRUB_ENTRY_NAME=\"Elemental\" >> /etc/os-release

# Good for validation after the build
CMD /bin/bash
CMD ["/bin/bash"]
15 changes: 6 additions & 9 deletions examples/orange/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# run `make build` to build local/elemental-toolkit image
ARG TOOLKIT_REPO
ARG VERSION
FROM ${TOOLKIT_REPO}:${VERSION} as TOOLKIT
ARG TOOLKIT_REPO=local/elemental-toolkit
ARG VERSION=latest
FROM ${TOOLKIT_REPO}:${VERSION} AS toolkit

# OS base image of our choice
FROM ubuntu:24.04 as OS
FROM ubuntu:24.04 AS os
ARG REPO
ARG VERSION
ENV VERSION=${VERSION}
Expand Down Expand Up @@ -62,11 +62,8 @@ RUN curl -L https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-${KBD}.tar.x
# Symlink grub2-editenv
RUN ln -sf /usr/bin/grub-editenv /usr/bin/grub2-editenv

# Create non FHS paths
RUN mkdir -p /oem /system

# Just add the elemental cli
COPY --from=TOOLKIT /usr/bin/elemental /usr/bin/elemental
COPY --from=toolkit /usr/bin/elemental /usr/bin/elemental

# Enable essential services
RUN systemctl enable systemd-networkd.service
Expand Down Expand Up @@ -99,4 +96,4 @@ RUN mkdir -p /usr/lib/elemental/bootloader && \
cp /usr/lib/shim/mmx64.efi /usr/lib/elemental/bootloader/mmx64.efi

# Good for validation after the build
CMD /bin/bash
CMD ["/bin/bash"]
Loading