Skip to content

Commit f72ac56

Browse files
committed
Add obs-service-cargo
1 parent 350958a commit f72ac56

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

osc/.devcontainer/Dockerfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,21 @@ RUN VERSION="$(grep -oP 'VERSION_ID="\K[^"]+' '/etc/os-release')" && \
88
curl --location "https://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_$VERSION/Release.key" | sudo gpg --dearmor --output '/etc/apt/keyrings/opensuse-tools.gpg' && \
99
echo "deb [signed-by=/etc/apt/keyrings/opensuse-tools.gpg] https://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_$VERSION ./" | sudo tee /etc/apt/sources.list.d/opensuse-tools.list
1010
RUN sudo apt update && \
11-
sudo apt install debconf-utils && \
11+
sudo apt install --assume-yes debconf-utils libssl-dev libzstd-dev pkg-config && \
1212
debconf-set-selections debconf && \
1313
sudo apt install --assume-yes 'osc' 'obs-service-*' 'libxml2-utils'
14-
RUN sudo rm -rf /var/lib/apt/lists/*
14+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable && \
15+
source "$HOME/.cargo/env" && \
16+
git clone --branch="$(curl 'https://api.github.com/repos/openSUSE-Rust/obs-service-cargo/releases/latest' | jq -r '.tag_name')" --depth=1 https://github.com/openSUSE-Rust/obs-service-cargo.git && \
17+
cd obs-service-cargo && \
18+
cargo build --release && \
19+
sudo install -m0644 cargo_vendor.service /lib/obs/service && \
20+
sudo install -m0755 target/release/cargo_vendor /lib/obs/service && \
21+
if [ -f 'target/release/cargo_audit' ]; then sudo install -m0755 target/release/cargo_audit /lib/obs/service; fi && \
22+
cd .. && \
23+
rm -fr obs-service-cargo
24+
25+
RUN source "$HOME/.cargo/env" && \
26+
sudo apt remove -y libssl-dev libzstd-dev && \
27+
rustup self uninstall -y && \
28+
sudo rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)