git clone https://github.com/jfrog/project-examples.git && cd project-examples/openshift-s2i-examples/cpp-conan
Follow the instructions to install s2i
docker build -t cpp-conan-builder:0.1 .
- The builder image uses conan to modularize a C++ application.
s2i build https://github.com/memsharded/example-poco-timer cpp-conan-builder:0.1 timer-app:0.1
- C++ dependencies including the transitive dependencies are pulled from conan-center.
- C++ packages can also be pulled from Artifactory since conan repositories are supported.
Access tokens can be used to authenticate with Artifactory $RT_URL and access conan repositories
export RESPONSE=$(curl -H "X-JFrog-Art-Api:$RT_API_KEY" -XPOST "$RT_URL/api/security/token" -d "username=$RT_USER" -d "scope=member-of-groups:readers" -d "expires_in=600")
export RT_ACCESS_TOKEN=$(echo "$RESPONSE"| jq -r .access_token)
s2i build https://github.com/memsharded/example-poco-timer cpp-conan-builder:0.1 timer-app:0.1 -e "RT_CONAN_URL=http://art-url/artifactory/api/conan/conan-local" -e "RT_USER=$RT_USER" -e "RT_ACCESS_TOKEN=$RT_ACCESS_TOKEN"
docker run -it timer-app:0.1