Installing Cygwin in Windows Docker container - docker

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

Related

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

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.

Docker machine installation for windows

I just installed docker-machine for windows using the following command:
It created a bin folder with a docker-machine.exe file.
However after checking if it installed correctly with docker-machine version. I get the following error:
/c/Users/samta/bin/docker-machine: line 1: syntax error near unexpected token `<'
Fixed it I download the docker-machine.exe file for windows from github: https://github.com/docker/machine/releases/
and replaced the generated file from the command above.

Unable to find chrome binary in WSL while running Rails tests

I am trying to run integration tests for my Rails application in Windows Subsystem for Linux. I have downloaded the chromedriver file for windows from the official site and placed it in Documents/bin folder. I have added the following file in the same folder and saved it as chromedriver:
#!/bin/sh
chromedriver.exe "$#"
So presently Documents/bin folder has these two files: chromedriver.exe and chromedriver. I have added this folder to PATH in windows.
When I type chromedriver -v in Ubuntu terminal in Windows I get the following output:
ChromeDriver 75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590e025-refs/branch-heads/3770#{#1003})
But when I execute any Rails integration test I am getting the following error:
sh: 1: ["/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", "/opt/google/chrome"]: not found
sh: 1: ["/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", "/opt/google/chrome"]: not found
sh: 1: ["/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", "/opt/google/chrome"]: not found
Webdrivers::VersionError: Failed to find Chrome binary or its version.
chrome version in windows: Version 75.0.3770.90 (Official Build) (64-bit)
So linux is able to find chromedriver but not rails. How can I rectify this error? Should I run sudo apt-get install chromium chrome-driver? Or is there another method to make rails know the path to chromedriver binary?
You need to add the path to your chrome.exe to the PATH environment variable in Ubuntu

java.lang.IllegalStateException: The driver executable does not exist: /usr/local/bin/chromedriver_linux64

Selenium scripts are running fine when i am trying to run via eclipse but it is throwing error if I am running via Jenkins.
Error in Jenkins console log : java.lang.IllegalStateException: The driver executable does not exist: /usr/local/bin/chromedriver_linux64
You need to make the driver executable as in linux/mac machines, the driver is not executable by default.
You can make the driver executable by first going to its location, in this case it would be like:
cd /usr/local/bin
And then you need to make it executable like:
chmod +x chromedriver_linux64

Run Vagrant inside Docker container

I am looking for a way to run vagrant inside docker container. I tried using Ubuntu base container but had faced some issues while doing vagrant up, it failed.
root#991baf290ddc:/srv# vagrant up
VirtualBox is complaining that the installation is incomplete. Please
run VBoxManage --version to see the error message which should contain
instructions on how to fix this error.
root#991baf290ddc:/srv# VBoxManage --version
WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-.
You will not be able to start VMs until this problem is fixed.
5.0.40_Ubuntur115130
I tried installing virtualbox-dkms package but no help.
Deleting module version: 5.0.40 completely from the DKMS tree.
Done.
Loading new virtualbox-5.0.40 DKMS files...
dpkg: warning: version '*-*' has bad syntax: version number does not start with digit
dpkg: warning: version '3.10.0-514.16.1.el7.x86_64' has bad syntax: invalid character in revision number
It is likely that 3.10.0-514.16.1.el7.x86_64 belongs to a chroot's host
Building only for *
Building initial module for *
: using /lib/modules/4.4.0-83-generic/build/.config
(I hope this is the correct config for this kernel)
Done.
Error! The directory /lib/modules/* doesn't exist.
You cannot install a module onto a non-existant kernel.
The command '/bin/sh -c dpkg-reconfigure virtualbox-dkms' returned a non-zero code: 6
[root#test-docker vagrant-in-docker]#

Resources