How do I use devicemapper in a Linux container - linux-containers

I would like to run some software (paradux) that uses devicemapper inside a Linux container started with systemd-nspawn. How do I get devicemapper (specifically via cryptsetup and LUKS) to work in the container?

Related

VSCode with Remote Docker does not launch Anaconda base and does not recognize the conda command

I use WSL2 and Desktop Container and my system is Windows 11. I create a container(the system used in the container is Ubuntu 20.04) and then connect the container with VSCode (remote docker). I have installed a miniconda in the container. But when I connected the container with VSCode, I can't use any conda commands. It seems that VSCode blocks the miniconda or doesn't recognize it. But I can use conda commands in this container if I access the container with "docker exec"(not with VSCode).
When I run "conda -h" in the VSCode, it shows the following information(conda does not work):
$ conda -h
bash: conda: command not found.
When I run "conda -h" in a container terminal(access with "docker exec"), it shows(conda works):
(base) root ➜ / $ conda -h
usage: conda [-h] [-V] command ...
conda is a tool for managing and deploying applications, environments and packages.
This problem may be similar to the problem which might cause by the VSCode while connecting a running container(VSCode does not launch Anaconda base Python).
But I have no idea why they happened.
Does anybody have any improvement to these problems? Thank you.
Python works all well in both cases.
The miniconda was installed into the Ubnutu system after I created the container. Is it the reason that VSCode does not recognize the conda commands?
I had problems with the same combination (vs code and anaconda) on Window 10.
In fact, there is a chance that you have to define your PATH variables for Anaconda and that it will work fine after that...
1. path\to\Anaconda\Scripts
2. path\to\Anaconda\Lib
3. path\to\Anaconda\
but it isn't the most elegant way. According to Anaconda the preferred way is working with a $PROFILE and $ENV VARIABLES
But on stackflow, are a lot of posts about similar problems I noticed:
Maybe in some of the comments you find your answer?
Conda: Creating a virtual environment
https://stackoverflow.com/questions/53137700/ssl-module-in-python-is-not-available-windows-7]
I hope you'll find it fast, probably something small and easy to change.
Like choosing the right terminal from VS Code or so...
Good luck!

Install MySQL on Windows Docker Image

Anyone had success adding MySQL to a Windows docker image? I tried two different ways of deploying MySQL to my image.
I tried using the msi from MySQL in non-interactive mode. Does not work at all in a container.
While Installing Mysql.msi through powershell getting below error
I tried extracting the zip to set things up manually using the mysqld commands does nothing at all. Literally nothing, the exectutables behave as if they just run and exit (no output, nothing):
https://github.com/Somesh-K/Automation-Mysql/blob/main/1.mysql_setup_v2.ps1
Something is very weird about all of this.
Yes, I know that there's a perfectly good MySQL docker linux container published by Oracle to Docker hub. This works. The problem is that running a Windows container and Linux container that need to interact creates a really unnecessary frustration for the user in terms of networking between the two.
Using a different back-end (like SQL server) for our application is not feasible and using .NET core instead of .NET framework is not feasible. To simplify, I'd like to just install MySQL on our windows based webserver docker image. This seems do-able using the two methods described in the links above, but as noted, it does not work and there's very odd behavior from the MySQL binaries when they are run in the container.
Here's an example of the odd behavior:
Install Docker Desktop for Windows
Download the Win32 install zips from MySQL and place in C:\mydata
https://dev.mysql.com/downloads/mysql/
Pull down the ASPNET image from Docker Hub, Run it, and Open up Powershell:
# docker pull mcr.microsoft.com/dotnet/framework/aspnet:4.8
# docker run --name testweb -v C:\mydata:C:\mydata:R -d mcr.microsoft.com/dotnet/framework/aspnet:4.8
# docker exec -it testweb powershell
C:\ > cd C:\mydata
C:\mydata\ > Expand-archive -path .\mysql-5.7.36-winx64.zip .
C:\mydata\ > cd \mysql-5.7.36-winx64\bin
C:\mydata\mysql-5.7.36-winx64\bin\ > .\mysql.exe -version
[zero output, acts like it's an empty executable]
Results
None of the executables/binaries in the extracted mysql bin directory on the container do anything at all. They behave as if someone wrote and executable that just exits. I thought I had a bad install zip so I extracted the same zip on my regular Windows 10 workstation. All of the binaries at least return errors or do something.
This is super odd. Any help would be appreciated.
Downloading this executable and putting it into my container seemed to do the trick:
https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe
Placed this on my container and started it
C:\vcredist.exe /Q
After doing this, the executables starting working:
C:\ > cmd.exe /C "C:\mysql\bin\mysqld" --initialize-insecure
C:\ > cmd.exe /C "C:\mysql\bin\mysqld" --install
C:\ > start-service mysql
C:\ > cmd.exe /C "C:\mysql\bin\mysql" -u root

Is there any windows container guide for puppeteer?

I'm trying to use PuppeteerSharp with .NET Core3.1 in a windows container, is there some necessary dependencies for using puppeteer in windows container?
When I use mcr.microsoft.com/windows/servercore:2004-amd64 image, seemed there's some dependencies missing, when I use mcr.microsoft.com/windows:2004-amd64, it works, but this image is too large.
Is there some guide for using windows container? Some necessary dependencies for windows container?

binary install in google container optimized OS

As it is the Linux version of OS, I tried firing, hoping that would work
apt-get install jq
But it says apt-get: command not found.
How I can install new binaries as I wanted to add some extra logic in the startup script which required few extra libs to be installed first.
Please correct me if I am doing anything wrong.
Container OS is locked down. You are prohibited from installing programs. Create a container and run the command in the container.
Container-Optimized OS does not include a package manager; as such,
you'll be unable to install software packages directly on an instance.
However, you can use CoreOS toolbox to install and run debugging and
admin tools in an isolated container.
Container-Optimized OS Overview
https://cloud.google.com/container-optimized-os/docs/how-to/toolbox
You can use toolbox to install the package
You can specify a startup script through the metadata server. The script would be run at boot time.

Can you run windows containers with portainer.io

If i try to use and docker image or template, it say's the image does not exist. My docker is running as windows containers.
Yes you can.
Altough you'll need to run Windows specific images. In the default App Templates list, you'll want to search for templates with the Windows icon.