Skip to content

Commit 5139c39

Browse files
author
Dusan Malusev
committed
Fixing docker file for development
Signed-off-by: Dusan Malusev <[email protected]>
1 parent 6a5027f commit 5139c39

File tree

2 files changed

+55
-38
lines changed

2 files changed

+55
-38
lines changed

.devcontainer/devcontainer.json

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/docker-existing-dockerfile
33
{
44
"name": "Existing Dockerfile",
5-
6-
// Sets the run context to one level up instead of the .devcontainer folder.
75
"context": "..",
8-
9-
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
106
"dockerFile": "../Dockerfile",
11-
12-
// Set *default* container specific settings.json values on container create.
137
"settings": {},
14-
15-
// Add the IDs of extensions you want installed when the container is created.
16-
"extensions": []
17-
18-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19-
// "forwardPorts": [],
20-
21-
// Uncomment the next line to run commands after the container is created - for example installing curl.
22-
// "postCreateCommand": "apt-get update && apt-get install -y curl",
23-
24-
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
25-
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
26-
27-
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
28-
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
29-
30-
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
31-
// "remoteUser": "vscode"
8+
"extensions": [
9+
"maelvalais.autoconf",
10+
"aaron-bond.better-comments",
11+
"jeff-hykin.better-cpp-syntax",
12+
"mads-hartmann.bash-ide-vscode",
13+
"ms-vscode.cpptools",
14+
"jbenden.c-cpp-flylint",
15+
"ms-vscode.cpptools-extension-pack",
16+
"xaver.clang-format",
17+
"p1c2u.docker-compose",
18+
"ms-azuretools.vscode-docker",
19+
"mikestead.dotenv",
20+
"usernamehw.errorlens",
21+
"eamodio.gitlens",
22+
"EditorConfig.EditorConfig",
23+
"christian-kohler.path-intellisense",
24+
"xdebug.php-debug",
25+
"bmewburn.vscode-intelephense-client",
26+
"ms-python.vscode-pylance",
27+
"ms-python.python",
28+
"JordanHury.sqltools-cassandra",
29+
"VisualStudioExptTeam.vscodeintellicode",
30+
"redhat.vscode-yaml"
31+
],
32+
"forwardPorts": [],
33+
"remoteUser": "root"
3234
}

Dockerfile

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
FROM php:8.0
1+
FROM malusevd99/php-ext-dev:8.1
2+
3+
ARG CPP_DRIVER_VERSION=2.16.2
24

35
ENV EXT_CASSANDRA_VERSION=master
6+
ENV LDFLAGS="-L/usr/local/lib"
7+
ENV LIBS="-lssl -lz -luv -lm -lgmp -lstdc++"
48

59
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
610
php composer-setup.php && php -r "unlink('composer-setup.php');" \
@@ -10,19 +14,30 @@ COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr
1014

1115
RUN docker-php-source extract \
1216
&& apt update -y \
13-
&& apt install python3 pip cmake unzip mlocate build-essential git libuv1-dev libssl-dev libgmp-dev openssl zlib1g-dev libpcre3-dev -y \
14-
&& git clone --branch $EXT_CASSANDRA_VERSION --depth 1 https://github.com/nano-interactive/php-driver.git /usr/src/php/ext/cassandra \
15-
&& cd /usr/src/php/ext/cassandra && git submodule update --init \
16-
&& mkdir -p /usr/src/php/ext/cassandra/lib/cpp-driver/build \
17-
&& cmake -DCMAKE_CXX_FLAGS="-fPIC" -DCASS_BUILD_STATIC=OFF -DCASS_BUILD_SHARED=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_LIBDIR:PATH=lib -DCASS_USE_ZLIB=ON /usr/src/php/ext/cassandra/lib/cpp-driver \
18-
&& make -j8 \
19-
&& make install \
17+
&& mkdir -p /cpp-driver \
18+
&& apt install \
19+
cmake \
20+
unzip \
21+
mlocate \
22+
build-essential \
23+
git \
24+
libuv1-dev \
25+
libssl-dev \
26+
libgmp-dev \
27+
zlib1g-dev \
28+
openssl \
29+
libpcre3-dev -y \
30+
&& git clone --recursive https://github.com/datastax/cpp-driver /cpp-driver \
31+
&& cd /cpp-driver && git checkout tags/$CPP_DRIVER_VERSION -b v$CPP_DRIVER_VERSION \
32+
&& mkdir -p build && cd build \
33+
&& cmake \
34+
-DCMAKE_CXX_FLAGS="-fPIC" \
35+
-DCASS_BUILD_STATIC=OFF \
36+
-DCASS_BUILD_SHARED=ON \
37+
-DCMAKE_BUILD_TYPE=RELEASE \
38+
-DCMAKE_INSTALL_LIBDIR:PATH=lib \
39+
-DCASS_USE_ZLIB=ON .. \
40+
&& make -j8 && make install \
2041
&& install-php-extensions intl zip pcntl gmp ast xdebug
2142

22-
RUN cd /usr/src/php/ext/cassandra/ext \
23-
&& phpize \
24-
&& LDFLAGS="-L/usr/local/lib" LIBS="-lssl -lz -luv -lm -lgmp -lstdc++" ./configure --with-cassandra=/usr/local \
25-
&& make -j8 && make install && updatedb && pip install ccm
26-
27-
2843
CMD ["bash"]

0 commit comments

Comments
 (0)