Skip to content

Commit

Permalink
Pull gcc build image from public ECR, bump version (#3108)
Browse files Browse the repository at this point in the history
- Change dockerhub gcc image to public ecr
- gcc version 7.3.0 is not available on public ecr, so just bumped
  version to the latest version available
- Also removed the ci-ecr-pull/push scripts as these are no longer
  necessary, since we have no more dockerhub images in our build or test
  workflows.
  • Loading branch information
sparrc committed Dec 15, 2021
1 parent 05321f7 commit 21cf3fb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 120 deletions.
1 change: 0 additions & 1 deletion Makefile
Expand Up @@ -226,7 +226,6 @@ cni-plugins: get-cni-sources .out-stamp build-ecs-cni-plugins build-vpc-cni-plug

.PHONY: codebuild
codebuild: .out-stamp
./scripts/ci-ecr-pull "us-west-2" 508403128001
$(MAKE) release TARGET_OS="linux"
TARGET_OS="linux" ./scripts/local-save
$(MAKE) docker-release TARGET_OS="windows"
Expand Down
2 changes: 1 addition & 1 deletion misc/pause-container/Dockerfile
Expand Up @@ -10,7 +10,7 @@
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
FROM gcc:7.3.0 as build
FROM public.ecr.aws/docker/library/gcc:11.2.0 as build

WORKDIR /src/
ADD . /src/
Expand Down
47 changes: 1 addition & 46 deletions scripts/ci-ecr-pull
Expand Up @@ -15,49 +15,4 @@
# limitations under the License.
set -e

dir=$(dirname "${BASH_SOURCE[0]}")
source "$dir/ci-ecr"

AWS_REGION="${1}"
AWS_ACCOUNT_ID="${2}"

usage() {
cat <<EOF
Usage: ${0} AWS_REGION AWS_ACCOUNT_ID
This script attempts to pull the following dockerhub images from ECR:
$IMAGES
It assumes that the ECR images will be formatted like:
AWS_ACCOUNT_ID.dkr.ecr.AWS_REGION.amazonaws.com/ci/IMAGE_OS/IMAGE_ARCH/IMAGE_NAME
(see ci-ecr-push for creating these)
EOF
}

if [ -z "$AWS_REGION" ]; then
usage
exit 1
fi

if [ -z "$AWS_ACCOUNT_ID" ]; then
usage
exit 1
fi

ECR_URI="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com"

aws --region "$AWS_REGION" ecr get-login-password | docker login --username AWS --password-stdin "$ECR_URI"

for image in $IMAGES; do
imageArch=$(docker version --format "{{.Server.Arch}}")
imageOS=$(docker version --format "{{.Server.Os}}")
fullRepoName="ci/$imageOS/$imageArch/$image"
fullURI="$ECR_URI/$fullRepoName"
echo "PULLING: $fullURI"
# ignore errors if repo doesnt exist or pull fails (fallback to dockerhub)
docker pull "$fullURI" || continue
docker tag "$fullURI" "$image"
done
exit 0
72 changes: 0 additions & 72 deletions scripts/ci-ecr-push

This file was deleted.

0 comments on commit 21cf3fb

Please sign in to comment.