-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-skywalking
32 lines (24 loc) · 1.38 KB
/
Dockerfile-skywalking
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARG PHP_VERSION=8.1
FROM php:${PHP_VERSION} as builder
ARG SKYAPM_VERS=v5.0.1
LABEL maintainer="[email protected]"
LABEL container="PHP apm image container"
ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=xterm-color
ENV SHELL=/bin/bash
ENV PROTOBUF_VERSION=3.14.0
ENV PROTOBUF_URL=https://github.com/protocolbuffers/protobuf/releases/download/v"$PROTOBUF_VERSION"/protobuf-cpp-"$PROTOBUF_VERSION".zip
RUN apt-get update && \
apt-get install -y git libcurl4-openssl-dev unzip
RUN curl https://sh.rustup.rs -LsSf | sh -s -- -y
ENV PATH=${PATH}:/root/.cargo/bin
RUN curl --silent -L -o /tmp/protobuf.zip $PROTOBUF_URL && cd /tmp/ && unzip protobuf.zip && \
cd protobuf-$PROTOBUF_VERSION && ./configure && make -j$(nproc) && make install && \
git clone --depth 1 -b ${SKYAPM_VERS} https://github.com/SkyAPM/SkyAPM-php-sdk.git /tmp/SkyAPM-php-sdk && cd /tmp/SkyAPM-php-sdk && \
phpize && git submodule update --init && ./configure && make install && docker-php-ext-enable skywalking
FROM php:${PHP_VERSION}
COPY --from=builder /usr/local/lib/php/extensions/*/skywalking.so /tmp/skywalking.so
COPY --from=builder /usr/local/etc/php/conf.d/docker-php-ext-skywalking.ini /usr/local/etc/php/conf.d/docker-php-ext-skywalking.ini
RUN mkdir -p $(php-config --extension-dir) && mkdir -p /src/ \
&& cp /tmp/skywalking.so $(php-config --extension-dir)/ \
&& mv /tmp/skywalking.so /src/