-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create docker base image for dd-library-php
- Loading branch information
1 parent
afa2b3c
commit 960f83d
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM datadog/dd-appsec-php-ci:php-7.0-release AS php_agent_debug | ||
RUN apt-get update && apt-get install -y jq | ||
COPY ./tooling/ci/ddlib-info.sh ./tooling/ci/binaries* /binaries/ | ||
RUN /binaries/ddlib-info.sh | ||
RUN php -d error_reporting='' -r 'echo phpversion("ddtrace");' > /binaries/LIBRARY_VERSION | ||
RUN touch -c -a -m -d @0 /binaries/* | ||
|
||
FROM scratch as collect | ||
COPY --from=php_agent_debug /binaries/dd-library-php-*-gnu.tar.gz / | ||
COPY --from=php_agent_debug /binaries/datadog-setup.php /datadog-setup.php | ||
COPY --from=php_agent_debug /binaries/LIBRARY_VERSION /LIBRARY_VERSION | ||
|
||
FROM scratch | ||
COPY --from=collect /* / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
PKG=$(find /binaries -maxdepth 1 -name 'dd-library-php-*-gnu.tar.gz') | ||
SETUP=/binaries/datadog-setup.php | ||
|
||
if [ "$PKG" != "" ] && [ ! -f "$SETUP" ]; then | ||
echo "local install failed: package located in /binaries but datadog-setup.php not present, please include it" | ||
exit 1 | ||
fi | ||
|
||
if [ "$PKG" == "" ]; then | ||
ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/') | ||
if [ "$ARCH" = "arm64" ]; then | ||
ARCH=aarch64 | ||
else | ||
ARCH=x86_64 | ||
fi | ||
unset PKG | ||
fi | ||
|
||
export PHP_INI_SCAN_DIR="/etc/php" | ||
|
||
echo "Installing php package ${PKG-"{default}"} with setup script $SETUP" | ||
php $SETUP --php-bin=all ${PKG+"--file=$PKG"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
VERSION=${1:-'dev'} | ||
|
||
echo "Load $VERSION binary " | ||
|
||
mkdir -p tooling/ci/binaries | ||
cd tooling/ci/binaries | ||
|
||
#This script resides inside of docker image (ci_docker_base) | ||
source /download-binary-tracer.sh | ||
|
||
if [ $VERSION = 'dev' ]; then | ||
get_circleci_artifact "gh/DataDog/dd-trace-php" "build_packages" "package extension" "dd-library-php-.*-x86_64-linux-gnu.tar.gz" "dd-library-php-x86_64-linux-gnu.tar.gz" | ||
get_circleci_artifact "gh/DataDog/dd-trace-php" "build_packages" "package extension" "datadog-setup.php" "datadog-setup.php" | ||
elif [ $VERSION = 'prod' ]; then | ||
get_github_release_asset "DataDog/dd-trace-php" "dd-library-php-.*-x86_64-linux-gnu.tar.gz" "dd-library-php-x86_64-linux-gnu.tar.gz" | ||
get_github_release_asset "DataDog/dd-trace-php" "datadog-setup.php" "datadog-setup.php" | ||
else | ||
echo "Don't know how to load version $VERSION for $TARGET" | ||
fi |