Skip to content

Commit 31096e7

Browse files
authored
Merge branch 'main' into debugprofile
2 parents 370806f + 6459879 commit 31096e7

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# /********************************************************************************
2+
# * Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
# *
4+
# * See the NOTICE file(s) distributed with this work for additional
5+
# * information regarding copyright ownership.
6+
# *
7+
# * This program and the accompanying materials are made available under the
8+
# * terms of the Apache License 2.0 which is available at
9+
# * http://www.apache.org/licenses/LICENSE-2.0
10+
# *
11+
# * SPDX-License-Identifier: Apache-2.0
12+
# ********************************************************************************/
13+
14+
FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm
15+
ARG DEBIAN_FRONTEND=noninteractive
16+
ENV CROSS_CONTAINER_IN_CONTAINER=true
17+
ENV TZ=Europe/Berlin
18+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
19+
RUN apt-get update -y
20+
RUN apt install software-properties-common build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl git libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev -y
21+
22+
USER vscode
23+
RUN cargo install cross cargo-license cargo-cyclonedx
24+
25+
# Installing pyEnv to set up specific version of Python
26+
ENV HOME=/home/vscode
27+
WORKDIR ${HOME}
28+
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
29+
ENV PYENV_ROOT="${HOME}/.pyenv"
30+
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
31+
ENV PYTHON_VERSION=3.12
32+
RUN pyenv install ${PYTHON_VERSION}
33+
RUN pyenv global ${PYTHON_VERSION}
34+
35+
# Fails due to gpg keyserver not accessible via corporate proxy
36+
# Moved to postStartCommand.sh for DevContainer
37+
# RUN pip install "git+https://github.com/eclipse-kuksa/kuksa-common.git@v1#subdirectory=sbom-tools"

.devcontainer/devcontainer.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
3+
{
4+
"name": "Kuksa DevContainer",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
},
8+
"features": {
9+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
10+
},
11+
"postStartCommand": "bash .devcontainer/postStartCommand.sh",
12+
"mounts": [
13+
{
14+
"target": "/var/run/docker.sock",
15+
"source": "/var/run/docker.sock",
16+
"type": "bind"
17+
}
18+
]
19+
}

.devcontainer/postStartCommand.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
4+
#
5+
# Building all currently supported targets for databroker-cli.
6+
# Uses cross for cross-compiling. Needs to be executed
7+
# before docker build, as docker collects the artifacts
8+
# created by this script
9+
# this needs the have cross, cargo-license and kuksa sbom helper
10+
# installed
11+
#
12+
# SPDX-License-Identifier: Apache-2.0
13+
14+
pip install "git+https://github.com/eclipse-kuksa/kuksa-common.git@v1#subdirectory=sbom-tools"

0 commit comments

Comments
 (0)