Skip to content

Commit

Permalink
Fix build warnings from BuildKit (#6476)
Browse files Browse the repository at this point in the history
Recent versions of BuildKit supports build checks:
https://docs.docker.com/reference/build-checks/

Because our Github CI uses a very recent version of buildx (through
docker/setup-buildx-action), CI builds have been reporting warnings
because we do not use the same casing for the "FROM" and "as" keywords
in our Dockerfiles:
https://docs.docker.com/reference/build-checks/from-as-casing/

To avoid these warnings, we fix the casing in all Dockerfiles.

Signed-off-by: Antonin Bas <[email protected]>
  • Loading branch information
antoninbas authored Jun 24, 2024
1 parent 0f75c50 commit 538df0e
Show file tree
Hide file tree
Showing 19 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.agent.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ARG GO_VERSION
ARG BUILD_TAG
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.agent.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ARG GO_VERSION
ARG BUILD_TAG
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.agent.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ARG GO_VERSION
ARG BUILD_TAG
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.controller.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ARG GO_VERSION
ARG BUILD_TAG
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.controller.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ARG GO_VERSION
ARG BUILD_TAG
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.controller.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ARG GO_VERSION
ARG BUILD_TAG
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down
4 changes: 2 additions & 2 deletions build/images/Dockerfile.build.windows
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ARG GO_VERSION
ARG OVS_VERSION

FROM --platform=linux/amd64 golang:${GO_VERSION} as antrea-build-windows
FROM --platform=linux/amd64 golang:${GO_VERSION} AS antrea-build-windows
ARG CNI_BINARIES_VERSION
ENV CNI_PLUGINS="./host-local.exe"

Expand All @@ -42,7 +42,7 @@ RUN mkdir -p /go/k/antrea/bin && \
cp /antrea/bin/antctl.exe /go/k/antrea/bin/ && \
cp /antrea/bin/antrea-cni.exe /go/k/antrea/cni/antrea.exe

FROM antrea/windows-ovs:${OVS_VERSION} as antrea-ovs
FROM antrea/windows-ovs:${OVS_VERSION} AS antrea-ovs

FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0
COPY --from=antrea-build-windows /go/k /k
Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.simulator.build.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG GO_VERSION
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG BUILD_TAG
FROM ubuntu:22.04 as cni-binaries
FROM ubuntu:22.04 AS cni-binaries

ARG CNI_BINARIES_VERSION

Expand Down
2 changes: 1 addition & 1 deletion build/images/base/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG BUILD_TAG
FROM ubuntu:22.04 as cni-binaries
FROM ubuntu:22.04 AS cni-binaries

ARG CNI_BINARIES_VERSION

Expand Down
2 changes: 1 addition & 1 deletion build/images/codegen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG GO_VERSION
FROM ubuntu:22.04 as protoc
FROM ubuntu:22.04 AS protoc

RUN apt-get update && \
apt-get install -y --no-install-recommends wget ca-certificates unzip
Expand Down
2 changes: 1 addition & 1 deletion build/images/flow-aggregator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG GO_VERSION
FROM golang:${GO_VERSION} as flow-aggregator-build
FROM golang:${GO_VERSION} AS flow-aggregator-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/flow-aggregator/Dockerfile.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG GO_VERSION
FROM golang:${GO_VERSION} as flow-aggregator-build
FROM golang:${GO_VERSION} AS flow-aggregator-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/ovs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:22.04 as ovs-debs
FROM ubuntu:22.04 AS ovs-debs

# Some patches may not apply cleanly if a non-default version is provided.
# See build/images/deps/ovs-version for the default version.
Expand Down
2 changes: 1 addition & 1 deletion build/images/ovs/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM quay.io/centos/centos:stream9 as ovs-rpms
FROM quay.io/centos/centos:stream9 AS ovs-rpms
# Some patches may not apply cleanly if a non-default version is provided.
# See build/images/deps/ovs-version for the default version.
ARG OVS_VERSION
Expand Down
2 changes: 1 addition & 1 deletion build/images/ovs/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=linux/amd64 ubuntu:22.04 as antrea-windows-builder
FROM --platform=linux/amd64 ubuntu:22.04 AS antrea-windows-builder
ARG OVS_VERSION

RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/multus/build/cni-dhcp-daemon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:22.04 as cni-binary
FROM ubuntu:22.04 AS cni-binary

LABEL maintainer="Antrea <[email protected]>"
LABEL description="A Docker which runs the dhcp daemon from the containernetworking project."
Expand Down
2 changes: 1 addition & 1 deletion multicluster/build/images/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG GO_VERSION
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down
2 changes: 1 addition & 1 deletion multicluster/build/images/Dockerfile.build.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

ARG GO_VERSION
FROM golang:${GO_VERSION} as antrea-build
FROM golang:${GO_VERSION} AS antrea-build

WORKDIR /antrea

Expand Down

0 comments on commit 538df0e

Please sign in to comment.