File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1+ FROM scratch
2+ ARG TARGETARCH
3+ COPY .layers/datadog_extension-$TARGETARCH-alpine/extensions/datadog-agent opt/extensions/datadog-agent
4+ COPY --chmod=0755 scripts/datadog_wrapper opt/datadog_wrapper
Original file line number Diff line number Diff line change 1010set -e
1111
1212DOCKER_REPOSITORY_NAME=" datadog/lambda-extension"
13- DOCKERFILE_LOCATION=" scripts/Dockerfile"
1413
1514# Move into the root directory, so this script can be called from any directory
1615SCRIPTS_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
@@ -24,10 +23,18 @@ if [ -z "$VERSION" ]; then
2423fi
2524
2625# Build the image, tagged with the version
27- echo " Building the Docker image, and pushing to Dockerhub"
26+ echo " Building the non-alpine Docker image, and pushing to Dockerhub"
2827docker buildx build --platform linux/arm64,linux/amd64 \
2928 -t $DOCKER_REPOSITORY_NAME :$VERSION \
3029 -t $DOCKER_REPOSITORY_NAME :latest \
3130 -f ./scripts/Dockerfile \
3231 --build-arg EXTENSION_VERSION=" ${VERSION} " . \
33- --push
32+ --push
33+
34+ echo " Building the alpine Docker image, and pushing to Dockerhub"
35+ docker buildx build --platform linux/arm64,linux/amd64 \
36+ -t $DOCKER_REPOSITORY_NAME :$VERSION -alpine \
37+ -t $DOCKER_REPOSITORY_NAME :latest-alpine \
38+ -f ./scripts/Dockerfile.alpine \
39+ --build-arg EXTENSION_VERSION=" ${VERSION} " . \
40+ --push
Original file line number Diff line number Diff line change @@ -89,11 +89,18 @@ if [ "$SERVERLESS_INIT" == "true" ]; then
8989elif [ " $ARCHITECTURE " == " amd64" ]; then
9090 echo " Building for amd64 only"
9191 docker_build_zip amd64
92+ BUILD_FILE=Dockerfile.alpine.build
93+ docker_build_zip amd64 -alpine
9294elif [ " $ARCHITECTURE " == " arm64" ]; then
9395 echo " Building for arm64 only"
9496 docker_build_zip arm64
97+ BUILD_FILE=Dockerfile.alpine.build
98+ docker_build_zip arm64 -alpine
9599else
96100 echo " Building for both amd64 and arm64"
97101 docker_build_zip amd64
98102 docker_build_zip arm64
103+ BUILD_FILE=Dockerfile.alpine.build
104+ docker_build_zip amd64 -alpine
105+ docker_build_zip arm64 -alpine
99106fi
You can’t perform that action at this time.
0 commit comments