From c07e6ee41fd77d109c86f583a0b3d6e45a1768c2 Mon Sep 17 00:00:00 2001 From: TGP Date: Thu, 20 Jan 2022 15:12:05 +0000 Subject: [PATCH] use new base image for build & release --- .circleci/config.yml | 4 ++-- docker/Dockerfile.base | 10 ++++++++++ docker/Dockerfile.build | 2 +- docker/Dockerfile.release | 2 +- docker/build.sh | 7 +++++++ 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 docker/Dockerfile.base create mode 100755 docker/build.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 256bb0ba..6cd80b3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,13 +4,13 @@ orbs: jobs: build: docker: - - image: mcr.microsoft.com/dotnet/sdk:6.0-alpine + - image: mijitt0m/ocelot-build:0.0.5 steps: - checkout - run: dotnet tool restore && dotnet cake release: docker: - - image: mcr.microsoft.com/dotnet/sdk:6.0-alpine + - image: mijitt0m/ocelot-build:0.0.5 steps: - checkout - run: dotnet tool restore && dotnet cake --target=Release diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base new file mode 100644 index 00000000..0f27d5ae --- /dev/null +++ b/docker/Dockerfile.base @@ -0,0 +1,10 @@ +# syntax=docker/dockerfile:1 +FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine + +RUN apk add bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib + +RUN curl -L --output ./dotnet-install.sh https://dot.net/v1/dotnet-install.sh + +RUN chmod u+x ./dotnet-install.sh + +RUN ./dotnet-install.sh -c 5.0 diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build index b7b75bc0..5e153ec0 100644 --- a/docker/Dockerfile.build +++ b/docker/Dockerfile.build @@ -2,7 +2,7 @@ # call from ocelot repo root with # docker build --platform linux/arm64 --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN -f ./docker/Dockerfile.build . # docker build --platform linux/amd64 --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN -f ./docker/Dockerfile.build . -FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build-env +FROM mijitt0m/ocelot-build:0.0.5 ARG OCELOT_COVERALLS_TOKEN diff --git a/docker/Dockerfile.release b/docker/Dockerfile.release index 3c4abd52..7be1fd0a 100644 --- a/docker/Dockerfile.release +++ b/docker/Dockerfile.release @@ -2,7 +2,7 @@ # call from ocelot repo root with # docker build --platform linux/arm64 --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN --build-arg OCELOT_GITHUB_API_KEY=$OCELOT_GITHUB_API_KEY --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN -f ./docker/Dockerfile.build . # docker build --platform linux/amd64 --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN --build-arg OCELOT_GITHUB_API_KEY=$OCELOT_GITHUB_API_KEY --build-arg OCELOT_COVERALLS_TOKEN=$OCELOT_COVERALLS_TOKEN -f ./docker/Dockerfile.build . -FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build-env +FROM mijitt0m/ocelot-build:0.0.5 ARG OCELOT_COVERALLS_TOKEN ARG OCELOT_NUTGET_API_KEY diff --git a/docker/build.sh b/docker/build.sh new file mode 100755 index 00000000..a1a5b1a6 --- /dev/null +++ b/docker/build.sh @@ -0,0 +1,7 @@ +# this script build the ocelot docker file +version=0.0.5 +docker build --platform linux/amd64 -t mijitt0m/ocelot-build -f Dockerfile.base . +echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin +docker tag mijitt0m/ocelot-build mijitt0m/ocelot-build:$version +docker push mijitt0m/ocelot-build:latest +docker push mijitt0m/ocelot-build:$version \ No newline at end of file