From 8e6fd16ed53ac7a499ddf86c8c64c793c583eaa0 Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Tue, 26 Sep 2023 17:47:03 +0200 Subject: [PATCH] chore(docker): Use ort namespace Language images lives under the ort namespace to avoid clash on main organization image naming, e.g. ghcr.io/oss-review-toolkit/python versus ghcr.io/oss-review-toolkit/ort/python. Signed-off-by: Helio Chissini de Castro --- Dockerfile-extended | 4 +-- scripts/docker_build.sh | 74 +++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/Dockerfile-extended b/Dockerfile-extended index 182b146b6b05c..3a878f1bb1e4f 100644 --- a/Dockerfile-extended +++ b/Dockerfile-extended @@ -1,5 +1,3 @@ -FROM ort - # Copyright (C) 2023 The ORT Project Authors (see ) # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,8 @@ FROM ort # SPDX-License-Identifier: Apache-2.0 # License-Filename: LICENSE +FROM ort + # Repo and Android ENV ANDROID_HOME=/opt/android-sdk ENV ANDROID_USER_HOME=$HOME/.android diff --git a/scripts/docker_build.sh b/scripts/docker_build.sh index 0c357107c8e7c..9a8ba59a44620 100755 --- a/scripts/docker_build.sh +++ b/scripts/docker_build.sh @@ -53,13 +53,13 @@ image_build() { } # Base -image_build base base "${JAVA_VERSION}-jdk-${UBUNTU_VERSION}" \ +image_build base ort/base "${JAVA_VERSION}-jdk-${UBUNTU_VERSION}" \ --build-arg UBUNTU_VERSION="$UBUNTU_VERSION" \ --build-arg JAVA_VERSION="$JAVA_VERSION" \ "$@" # Python -image_build python python "$PYTHON_VERSION" \ +image_build python ort/python "$PYTHON_VERSION" \ --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg CONAN_VERSION="$CONAN_VERSION" \ --build-arg PYTHON_INSPECTOR_VERSION="$PYTHON_INSPECTOR_VERSION" \ @@ -67,48 +67,48 @@ image_build python python "$PYTHON_VERSION" \ --build-arg PYTHON_POETRY_VERSION="$PYTHON_POETRY_VERSION" \ --build-arg PIPTOOL_VERSION="$PIPTOOL_VERSION" \ --build-arg SCANCODE_VERSION="$SCANCODE_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Nodejs -image_build nodejs nodejs "$NODEJS_VERSION" \ +image_build nodejs ort/nodejs "$NODEJS_VERSION" \ --build-arg NODEJS_VERSION="$NODEJS_VERSION" \ --build-arg BOWER_VERSION="$BOWER_VERSION" \ --build-arg NPM_VERSION="$NPM_VERSION" \ --build-arg PNPM_VERSION="$PNPM_VERSION" \ --build-arg YARN_VERSION="$YARN_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Rust -image_build rust rust "$RUST_VERSION" \ +image_build rust ort/rust "$RUST_VERSION" \ --build-arg RUST_VERSION="$RUST_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Ruby -image_build ruby ruby "$RUBY_VERSION" \ +image_build ruby ort/ruby "$RUBY_VERSION" \ --build-arg RUBY_VERSION="$RUBY_VERSION" \ --build-arg COCOAPODS_VERSION="$COCOAPODS_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Golang -image_build golang golang "$GO_VERSION" \ +image_build golang ort/golang "$GO_VERSION" \ --build-arg GO_VERSION="$GO_VERSION" \ --build-arg GO_DEP_VERSION="$GO_DEP_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Runtime ORT image image_build run ort "$GIT_REVISION" \ - --build-context "python=docker-image://${DOCKER_IMAGE_ROOT}/python:latest" \ --build-arg NODEJS_VERSION="$NODEJS_VERSION" \ - --build-context "nodejs=docker-image://${DOCKER_IMAGE_ROOT}/nodejs:latest" \ - --build-context "rust=docker-image://${DOCKER_IMAGE_ROOT}/rust:latest" \ - --build-context "golang=docker-image://${DOCKER_IMAGE_ROOT}/golang:latest" \ - --build-context "ruby=docker-image://${DOCKER_IMAGE_ROOT}/ruby:latest" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ + --build-context "python=docker-image://${DOCKER_IMAGE_ROOT}/ort/python:latest" \ + --build-context "nodejs=docker-image://${DOCKER_IMAGE_ROOT}/ort/nodejs:latest" \ + --build-context "rust=docker-image://${DOCKER_IMAGE_ROOT}/ort/rust:latest" \ + --build-context "golang=docker-image://${DOCKER_IMAGE_ROOT}/ort/golang:latest" \ + --build-context "ruby=docker-image://${DOCKER_IMAGE_ROOT}/ort/ruby:latest" \ "$@" # Build adjacent language containers if ALL_LANGUAGES is set. @@ -116,52 +116,54 @@ image_build run ort "$GIT_REVISION" \ # Android # shellcheck disable=SC1091 -image_build android android "$ANDROID_CMD_VERSION" \ +image_build android ort/android "$ANDROID_CMD_VERSION" \ --build-arg ANDROID_CMD_VERSION="$ANDROID_CMD_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Swift -image_build swift swift "$SWIFT_VERSION" \ +image_build swift ort/swift "$SWIFT_VERSION" \ --build-arg SWIFT_VERSION="$SWIFT_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # SBT -image_build sbt sbt "$SBT_VERSION" \ +image_build scala ort/scala "$SBT_VERSION" \ --build-arg SBT_VERSION="$SBT_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Dart -image_build dart dart "$DART_VERSION" \ +image_build dart ort/dart "$DART_VERSION" \ --build-arg DART_VERSION="$DART_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Dotnet -image_build dotnet dotnet "$DOTNET_VERSION" \ +image_build dotnet ort/dotnet "$DOTNET_VERSION" \ --build-arg DOTNET_VERSION="$DOTNET_VERSION" \ --build-arg NUGET_INSPECTOR_VERSION="$NUGET_INSPECTOR_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" # Haskell -image_build haskell haskell "$HASKELL_STACK_VERSION" \ +image_build haskell ort/haskell "$HASKELL_STACK_VERSION" \ --build-arg HASKELL_STACK_VERSION="$HASKELL_STACK_VERSION" \ - --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/base:latest" \ + --build-context "base=docker-image://${DOCKER_IMAGE_ROOT}/ort/base:latest" \ "$@" -# Runtime Extended ORT image +# Runtime extended ORT image docker buildx build \ --file Dockerfile-extended \ --tag "${DOCKER_IMAGE_ROOT}/ort-extended:$GIT_REVISION" \ --tag "${DOCKER_IMAGE_ROOT}/ort-extended:latest" \ - --build-context "sbt=docker-image://${DOCKER_IMAGE_ROOT}/sbt:latest" \ - --build-context "dotnet=docker-image://${DOCKER_IMAGE_ROOT}/dotnet:latest" \ - --build-context "swift=docker-image://${DOCKER_IMAGE_ROOT}/swift:latest" \ - --build-context "android=docker-image://${DOCKER_IMAGE_ROOT}/android:latest" \ - --build-context "dart=docker-image://${DOCKER_IMAGE_ROOT}/dart:latest" \ - --build-context "haskell=docker-image://${DOCKER_IMAGE_ROOT}/haskell:latest" \ + --build-context "ort=docker-image://${DOCKER_IMAGE_ROOT}/ort:latest" \ + --build-context "sbt=docker-image://${DOCKER_IMAGE_ROOT}/ort/sbt:latest" \ + --build-context "dotnet=docker-image://${DOCKER_IMAGE_ROOT}/ort/dotnet:latest" \ + --build-context "swift=docker-image://${DOCKER_IMAGE_ROOT}/ort/swift:latest" \ + --build-context "android=docker-image://${DOCKER_IMAGE_ROOT}/ort/android:latest" \ + --build-context "dart=docker-image://${DOCKER_IMAGE_ROOT}/ort/dart:latest" \ + --build-context "haskell=docker-image://${DOCKER_IMAGE_ROOT}/ort/haskell:latest" \ + --build-context "scala=docker-image://${DOCKER_IMAGE_ROOT}/ort/scala:latest" \ "$@" .