KDevelop can't find cmake in /usr/sbin/ - docker

I'm following https://develop.kde.org/docs/kirigami/introduction-getting_started/#mainqml (kirigami introduction) to create apps for my pinephone (arch64v8). I'm using KDevelop and have an aarch64 docker container with Arch ARM, which I want to use as a build host.
KDevelop finds the container, but building fails after:
docker: Error response from daemon: failed to create shim: OCI runtime create failed:
runc create failed: unable to start container process: exec: "/usr/bin/cmake": stat
/usr/bin/cmake: no such file or directory: unknown.
cmake is in /usr/sbin/, not /usr/bin.
I tried changing the cmake location in KDevelop's global CMake configuration, but that didn't help.
I could cymlink cmake in the container, but that's hard to maintain.
How do I tell KDevelop where to find cmake in the container?

Apparently, the solution was to remove the ,kdev4 file and reopen the project. Then you get a chance to say where the cmake is.

Related

Is it possible to run spleeter on mac m1?

I tried to download spleeter on my mac m1 version, but it keeps to occur errors everytime no matter what method I use.
Using pip :
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
Using docker:
WARNING: The requested image's platform (linux/amd64) does not match the detected
host platform (linux/arm64/v8) and no specific platform was requested
docker: Error response from daemon: failed to create shim task: OCI runtime
create failed: runc create failed: unable to start container process: error during
container init: error mounting "/host_mnt/Users/ghboo/output" to rootfs at "/output":
mount /host_mnt/Users/ghboo/output:/output (via /proc/self/fd/14), flags: 0x5000:
not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
I think spleeter's docker image doesn't support for m1 chip
https://github.com/deezer/spleeter/issues/696
Anything doesn't let me run spleeter. Please help.

Installing Cygwin in Windows Docker container

An attempt to install Cygwin in an Docker container on Windows fails with the error:
re-exec error: exit status 1: output: time="2020-12-11T15:00:26+01:00" level=error msg="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)" error="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)" importFolderPath="D:\\docker\\tmp\\hcs678884955" path="\\\\?\\D:\\docker\\windowsfilter\\9b956fcbc6cf19ba2f18fe39e12639da939e14916f019a32541df16e7dbf5b1e"
hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)
At https://github.com/microsoft/hcsshim/issues/835, they write that hardlinks are the reason for the problem. Zipping/unzipping the CygWin folder should help fix it but, using Cygwin installer, you have no control over the unattended installation.
Is there any other method for how Cygwin can be installed in a Docker container?
Is it possible to suppress the creation of hardlinks by Cygwin installer?
This is caused by the fact that cygwin is using hard links that seems cause docker to fail, try to install cygwin locally, then zip & unzip into the separate folder, they simply add cygwin using ADD

v4l2loopback on gcp cannot depmod / compile

i'm trying to make fake webcam using v4l2loopback on a docker container inside gcp instance.
i'm using debian:stretch with 4.9.0-9-amd64 kernel
so far, these are steps that i tried to compile the v4l2loopback:
`apt install linux-headers-$(uname -r)` to install proper header
`apt-get install kmod` and `apt-get install make` so i can use `make` and `depmod` feature
`apt-get install aufs-dkms aufs-tools aufs-dev` to get the `modules.builtin.bin` file
after steps above, i cloned the v4l2loopback repo, run make && sudo make install command, and finally depmod -a command. But when i run depmod -a, i got this warning:
depmod: WARNING: could not open /lib/modules/4.9.0-9-amd64/modules.order: No such file or directory
depmod: WARNING: could not open /lib/modules/4.9.0-9-amd64/modules.builtin: No such file or directory
when i check it manually, there are no modules.order and modules.builtin inside the /lib/modules/4.9.0-9-amd64 directory.
so when i tried to load the v4l2loopback module using modprobe v4l2loopback, it gives me error like this:
modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/4.9.0-9-amd64/modules.builtin.bin'
modprobe: ERROR: could not insert 'v4l2loopback': Operation not permitted
how can i fix this? or how can i compile the v4l2loopback properly on my environment?
In my case, I realized that it is only possible to load the module via insmod command instead of modprobe and you would be ready to use. Here you can find an explanation about the differences between these methods.
Example: sudo insmod PATH/TO/THE/FILE/v4l2loopback.ko devices=2 card_label="camera1","camera2" exclusive_caps=1,1

Unable to run a Docker image with a Rust executable

I am trying to create an image with my binary file (written in Rust) but I get different errors. This is my Dockerfile:
FROM scratch
COPY binary /
COPY .env /
COPY cert.pem /etc/ssl/
ENV RUST_BACKTRACE 1
CMD /binary
Building finishes fine but when I try to run it I get this:
$ docker run binary
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown.
ERRO[0000] error waiting for container: context canceled
And this:
$ docker run binary /binary
standard_init_linux.go:195: exec user process caused "no such file or directory"
I have no idea what to do. The error message looks very odd to me. According to the official Docker documentation it must work.
System info: latest Arch Linux and Docker:
Docker version 18.02.0-ce, build fc4de447b5
I tested with a C++ program and it works fine, with both clang and gcc.
It does not work with scratch, alpine, busybox ,or bash-based images, but it does work with postgresql, ubuntu, and debian images. The exact problem is something related to Rust and lightweight docker images - everything works okay otherwise.
As #Oleg Sklyar pointed out, the problem is that the Rust binary is dynamically-linked.
This may be a bit confusing because many people who have heard of Rust have also heard that Rust binaries are statically-linked, but this refers to the Rust code in crates: crates are linked statically because they are all known at the moment of compilation. This does not refer to existing C dynamic libraries that the program may link to, such as libc and other must-have libraries. Often times, these libraries can also be built as statically-linked artifacts (see the end of this post). To check whether your program or library is dynamically-linked, you can use ldd utility:
$ ldd target/release/t
linux-vdso.so.1 (0x00007ffe43797000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fa78482d000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007fa784625000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fa784407000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fa7841f0000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007fa783e39000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fa784ca2000)
You'll need these libraries in your Docker image. You will also need the interpreter; to get its path you can use objdump utility:
$ LANG=en objdump -s -j .interp target/release/t
target/release/t: file format elf64-x86-64
Contents of section .interp:
0270 2f6c6962 36342f6c 642d6c69 6e75782d /lib64/ld-linux-
0280 7838362d 36342e73 6f2e3200 x86-64.so.2.
Copy the files into the expected directories and everything works okay.
There is also a second option which is to use the rust-musl-builder docker image. There are some problems with postgresql and diesel but for most of projects it would be good. It works by producing a statically-linked executable which you may just copy and use. This option is much more preferred than using an interpreter and dynamic libraries if you want to provide a docker image with less size and without having all that useless extra data such as interpreter, unused libraries and so on.
In my case, the issue was that I was passing an invalid executable name:
CMD ["liquidator"]
liquidator was the name of the Docker image, but I needed this:
CMD ["hifi-liquidator"]
Basically the CMD must be the same as the "name" field in the Cargo.toml file.

cp: cannot stat on ./startFabric.sh in Docker for Hyperledger Fabric-Writing Yout First Application

I am currently trying to learn Hyperledger Fabric. I have followed all the instructions till here. I have gotten all the necessary binaries and downloaded all the required samples. When I go into the Fabcar folder and use the "ls" command, I can see all the files expected according to the document EXCEPT chaincode.
$ ls
creds/ invoke.js package.json query.js startFabric.sh*
When I run "./startFabric.sh" command, I get the following errors:
$ ./startFabric.sh
cp: cannot stat '/c/Users/Vaibhav': No such file or directory
cp: cannot stat 'Shah/fabric-samples/fabcar/creds/*': No such file or directory
I am attaching a screenshot of the entire Docker interface below.
Thank you very much.
Screenshot of error in Docker
Check this example in https://github.com/hyperledger/fabric/tree/release/examples/e2e_cli
This is the end-to-end test of the fabric using the command line interface. It helps you understand installation, setting up channels and executing if I recall chaincode_example02. Obviously, this runs on Ubuntu 14.04.
If you are a Windows user, you may want to spin up an Ubuntu 14.04 VM and try out, after installing all the pre-requisites.

Resources