Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Silicon and basic cross compiling support #26

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions build-image-src/build_all_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,29 @@ else
echo "SAM CLI VERSION: $SAM_CLI_VERSION";
fi

docker build -f Dockerfile-nodejs10x -t amazon/aws-sam-cli-build-image-nodejs10.x --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-nodejs12x -t amazon/aws-sam-cli-build-image-nodejs12.x --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-nodejs14x -t amazon/aws-sam-cli-build-image-nodejs14.x --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-java11 -t amazon/aws-sam-cli-build-image-java11 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-java8 -t amazon/aws-sam-cli-build-image-java8 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-java8-al2 -t amazon/aws-sam-cli-build-image-java8.al2 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-provided -t amazon/aws-sam-cli-build-image-provided --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-provided-al2 -t amazon/aws-sam-cli-build-image-provided.al2 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-python27 -t amazon/aws-sam-cli-build-image-python2.7 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-python36 -t amazon/aws-sam-cli-build-image-python3.6 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-python37 -t amazon/aws-sam-cli-build-image-python3.7 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-python38 -t amazon/aws-sam-cli-build-image-python3.8 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
# Disable DOCKER_CONTENT_TRUST for pulling from public ECR
DOCKER_CONTENT_TRUST=0 docker build -f Dockerfile-python39 -t amazon/aws-sam-cli-build-image-python3.9 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-ruby25 -t amazon/aws-sam-cli-build-image-ruby2.5 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-ruby27 -t amazon/aws-sam-cli-build-image-ruby2.7 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker build -f Dockerfile-go1x -t amazon/aws-sam-cli-build-image-go1.x --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
if [ ${SAM_CLI_CROSS_BUILD} ];
then
CROSS_DOCKER_BUILDX="buildx"
HOST_PLATFORM="`uname -o`/`uname -m`"
GUEST_PLATFORM="--platform=linux/amd64"
echo "Cross compiling of SAM CLI activated. Host is " ${HOST_PLATFORM} " with target platform flag set to: " ${GUEST_PLATFORM}
fi

docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-nodejs10x -t amazon/aws-sam-cli-build-image-nodejs10.x --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-nodejs12x -t amazon/aws-sam-cli-build-image-nodejs12.x --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-nodejs14x -t amazon/aws-sam-cli-build-image-nodejs14.x --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-java11 -t amazon/aws-sam-cli-build-image-java11 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-java8 -t amazon/aws-sam-cli-build-image-java8 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-java8-al2 -t amazon/aws-sam-cli-build-image-java8.al2 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-provided -t amazon/aws-sam-cli-build-image-provided --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-provided-al2 -t amazon/aws-sam-cli-build-image-provided.al2 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-python27 -t amazon/aws-sam-cli-build-image-python2.7 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-python36 -t amazon/aws-sam-cli-build-image-python3.6 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-python37 -t amazon/aws-sam-cli-build-image-python3.7 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-python38 -t amazon/aws-sam-cli-build-image-python3.8 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-python39 -t amazon/aws-sam-cli-build-image-python3.9 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-ruby25 -t amazon/aws-sam-cli-build-image-ruby2.5 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-ruby27 -t amazon/aws-sam-cli-build-image-ruby2.7 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
docker ${CROSS_DOCKER_BUILDX} build ${GUEST_PLATFORM} -f Dockerfile-go1x -t amazon/aws-sam-cli-build-image-go1.x --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
# Disable DOCKER_CONTENT_TRUST for pulling from public ECR
DOCKER_CONTENT_TRUST=0 docker build -f Dockerfile-dotnetcore31 -t amazon/aws-sam-cli-build-image-dotnetcore3.1 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .
DOCKER_CONTENT_TRUST=0 docker build -f Dockerfile-dotnetcore31 -t amazon/aws-sam-cli-build-image-dotnetcore3.1 --build-arg SAM_CLI_VERSION=$SAM_CLI_VERSION .