Skip to content

Commit

Permalink
Swap to alpine container to minimize dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Vazquez <[email protected]>
  • Loading branch information
austinvazquez committed Apr 22, 2024
1 parent 70c9c37 commit 8aaee2f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions .codebuild/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ phases:
install:
commands:
- chmod +x -R scripts
- ./scripts/install_deps.sh
- ./scripts/hack/codepipeline-git-commit.sh
- ./scripts/hack/symlink-gopath-codebuild.sh
- cd /go/src/github.com/awslabs/amazon-ecr-credential-helper
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ jobs:
cross-compile:
runs-on: 'ubuntu-22.04'
container: public.ecr.aws/docker/library/golang:1.21
container: public.ecr.aws/docker/library/golang:1.21-alpine
steps:
# Workaround for https://github.com/actions/checkout/issues/335
- name: Update Git
run: apk add --no-cache git
- uses: actions/checkout@v4
with:
path: src/github.com/awslabs/amazon-ecr-credential-helper
- name: Install dependencies to container
run: ./scripts/install_deps.sh
working-directory: src/github.com/awslabs/amazon-ecr-credential-helper
- name: Cross-compile all variants
run: make all-variants
working-directory: src/github.com/awslabs/amazon-ecr-credential-helper
Expand Down
25 changes: 25 additions & 0 deletions scripts/install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

# Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed 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.

# A POSIX shell script which installs the required dependencies
# to build the Amazon ECR credential helper variants in a Golang
# Alpine container.

set -ex

apk add --no-cache \
bash \
git \
make

0 comments on commit 8aaee2f

Please sign in to comment.