This is an automated email from the ASF dual-hosted git repository.

rlenferink pushed a commit to branch feature/add-dev-container
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 55ad18a1aeeb77e1bbc2f26f1fda1bb1411b0f91
Author: Roy Lenferink <[email protected]>
AuthorDate: Sun Sep 24 20:37:28 2023 +0200

    Add dev container with Celix dependencies
    
    This allows building and developing of Celix by using this pre-built 
container
---
 container/Containerfile.ubuntu         | 45 ++++++++++++++++++++++++++++++++++
 container/start-ubuntu-container.sh    | 37 ++++++++++++++++++++++++++++
 container/support-scripts/build-all.sh | 34 +++++++++++++++++++++++++
 3 files changed, 116 insertions(+)

diff --git a/container/Containerfile.ubuntu b/container/Containerfile.ubuntu
new file mode 100644
index 00000000..00ff029f
--- /dev/null
+++ b/container/Containerfile.ubuntu
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM 
docker.io/library/ubuntu:22.04@sha256:b492494d8e0113c4ad3fe4528a4b5ff89faa5331f7d52c5c138196f69ce176a6
+
+# Install build & Celix dependencies
+RUN apt-get update && \
+    apt-get install -y --no-install-recommends \
+        # Build dependencies \
+        build-essential \
+        ccache \
+        cmake \
+        curl \
+        default-jdk \
+        git \
+        python3 \
+        # Celix dependencies \
+        civetweb \
+        libavahi-compat-libdnssd-dev \
+        libcivetweb-dev \
+        libcpputest-dev \
+        libcurl4-openssl-dev \
+        libczmq-dev \
+        libffi-dev \
+        libjansson-dev \
+        libxml2-dev \
+        libzip-dev \
+        rapidjson-dev \
+        uuid-dev && \
+    apt-get clean
+
diff --git a/container/start-ubuntu-container.sh 
b/container/start-ubuntu-container.sh
new file mode 100755
index 00000000..118673ad
--- /dev/null
+++ b/container/start-ubuntu-container.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Start a Celix dev container with all needed dependencies
+# pre-installed already.
+
+SCRIPT_LOCATION=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
+CELIX_REPO_ROOT=$(realpath "${SCRIPT_LOCATION}/..")
+
+# Start a container with all the Celix dependencies pre-installed
+#   --privileged            to allow the unit tests to change thread priorities
+#   --net=host              is used to allow e.g. communication with etcd
+#   --volume & --workdir    are set to the Celix repo root (to allow building 
and editing of the Celix repo)
+#   --security-opt          disables SELinux for the container
+podman run -it --rm --privileged \
+           --net=host \
+           --volume "${CELIX_REPO_ROOT}":"${CELIX_REPO_ROOT}" \
+           --workdir "${CELIX_REPO_ROOT}" \
+           --security-opt label=disable \
+           apache/celix-dev:2.4.0-ubuntu
+
diff --git a/container/support-scripts/build-all.sh 
b/container/support-scripts/build-all.sh
new file mode 100755
index 00000000..3b083c01
--- /dev/null
+++ b/container/support-scripts/build-all.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+BUILD_TYPE=${1:-Debug}
+
+cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
+      -DCMAKE_INSTALL_PREFIX=../celix_install \
+      -DBUILD_EXPERIMENTAL=ON \
+      -DENABLE_TESTING=ON \
+      -DENABLE_TESTING_DEPENDENCY_MANAGER_FOR_CXX11=ON \
+      -DENABLE_TESTING_FOR_CXX14=ON \
+      -DENABLE_TESTING_ON_CI=ON \
+      -DRSA_JSON_RPC=ON \
+      -DRSA_SHM=ON \
+      -DRSA_REMOTE_SERVICE_ADMIN_SHM_V2=ON \
+      -DSHELL_BONJOUR=ON \
+      ..
+

Reply via email to