Devcontainer slow prog

This commit is contained in:
30hours 2024-02-15 11:01:11 +00:00
parent e17c04af0a
commit c8cc3d378a
3 changed files with 57 additions and 32 deletions

View file

@ -3,39 +3,40 @@
# ubuntu-22.04 by default # ubuntu-22.04 by default
ARG VARIANT="jammy" ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT} FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}
LABEL maintainer="30hours <nathan@30hours.dev>"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
# Feel like this shouldn't be needed but it drops me in / during build
WORKDIR /workspace
RUN apt-get update \ WORKDIR /blah2
# ADD lib lib
# Install dev tools and package dependencies RUN apt-get update && apt-get install -y software-properties-common \
&& apt-get install -y clang-tidy clang-format doxygen graphviz gfortran \ && apt-add-repository ppa:ettusresearch/uhd \
libfftw3-dev liblapack-dev libopenblas-dev libudev-dev libusb-1.0.0-dev \ && apt-get update \
# && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \
# Clean up g++ make cmake git curl zip unzip doxygen graphviz \
&& apt-get autoremove -y \ libfftw3-dev pkg-config gfortran \
&& apt-get clean -y \ libuhd-dev=4.6.0.0-0ubuntu1~jammy1 \
&& rm -rf /var/lib/apt/lists/* uhd-host=4.6.0.0-0ubuntu1~jammy1 \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies from vcpkg # install dependencies from vcpkg
RUN vcpkg integrate install \ RUN git clone https://github.com/microsoft/vcpkg /opt/vcpkg \
&& vcpkg install catch2 \ && /opt/vcpkg/bootstrap-vcpkg.sh
&& vcpkg install rapidjson \ ENV PATH="/opt/vcpkg:${PATH}" VCPKG_ROOT=/opt/vcpkg
&& vcpkg install asio \ RUN cd /blah2/lib && vcpkg integrate install \
&& vcpkg install cpp-httplib \ && vcpkg install --clean-after-build
&& vcpkg install armadillo \
&& vcpkg install ryml
COPY lib/sdrplay-3.0.7/SDRplay_RSP_API-Linux-3.07.1.run /workspace/ # install SDRplay API
RUN chmod +x /blah2/lib/sdrplay-3.14.0/SDRplay_RSP_API-Linux-3.14.0.run \
&& /blah2/lib/sdrplay-3.14.0/SDRplay_RSP_API-Linux-3.14.0.run --tar -xvf -C /blah2/lib/sdrplay-3.14.0 \
&& cp /blah2/lib/sdrplay-3.14.0/x86_64/libsdrplay_api.so.3.14 /usr/local/lib/libsdrplay_api.so \
&& cp /blah2/lib/sdrplay-3.14.0/x86_64/libsdrplay_api.so.3.14 /usr/local/lib/libsdrplay_api.so.3.14 \
&& cp /blah2/lib/sdrplay-3.14.0/inc/* /usr/local/include \
&& chmod 644 /usr/local/lib/libsdrplay_api.so /usr/local/lib/libsdrplay_api.so.3.14 \
&& ldconfig
# Install shitty sdrplay API # install UHD API
RUN chmod +x /workspace/SDRplay_RSP_API-Linux-3.07.1.run \ RUN uhd_images_downloader
&& /workspace/SDRplay_RSP_API-Linux-3.07.1.run --tar -xf \
&& cp x86_64/libsdrplay_api.so.3.07 /usr/local/lib/libsdrplay_api.so \
&& ln -s /usr/local/lib/libsdrplay_api.so /usr/local/lib/libsdrplay_api.so.3.07 \
&& cp inc/* /usr/local/include \
&& chmod 644 /usr/local/lib/libsdrplay_api.so /usr/local/lib/libsdrplay_api.so.3.07 \
&& ldconfig

View file

@ -1 +1,23 @@
# todo: write readme on using devcontainer with dev-release # todo: currently not working
## Usage
Install a recent `nodejs` using [nvm](https://github.com/nvm-sh/nvm).
```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install node 21.6.2
```
Install the latest [devcontainer CLI](https://code.visualstudio.com/docs/devcontainers/devcontainer-cli).
```
npm install -g @devcontainers/cli
devcontainer --version
```
Run the devcontainer.
```
devcontainer up --workspace-folder .
```

View file

@ -1,5 +1,7 @@
version: "3.2" version: "3.2"
services: services:
blah2-dev: blah2-dev:
user: vscode user: vscode
build: build: