Installing cassandra on RHEL using docker - docker

I am trying to install cassandra on RHEL-7 from source code using docker.
I have done following steps inside the container:
1 - yum install -y git java-1.8.0-openjdk-devel ant
2- export JAVA_HOME=/usr/lib/jvm/java-1.8.0
3- export PATH=$PATH:$JAVA_HOME/bin
4- export ANT_HOME=/usr/share/ant
5- export PATH=$PATH:$ANT_HOME/bin
6- export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
7 -git clone https://github.com/apache/cassandra.git
8 -cd cassandra && ant
The build is successful. But when I try to start cassandra server inside container I am getting following error:
A fatal error has been detected by the Java Runtime Environment:
Internal Error (cppInterpreter_zero.cpp:812), pid=836, tid=4397984807184
Error: Unimplemented()
Any idea?

Related

How to install docker correctly in ubuntu 22.04 is it possible at this time?

I am following the docker installation tutorial in ubuntu: https://docs.docker.com/desktop/linux/install/ubuntu/
And when I try this step: sudo apt install ./docker-desktop-4.8.1-amd64.deb I am getting the next error: E: Unsupported file ./docker-desktop-4.8.1-amd64.deb given on commandline
Not sure what that means or if I am missing something.
E: Unsupported file ./docker-desktop-4.8.1-amd64.deb given on commandline
I also tried with:
curl https://desktop-stage.docker.com/linux/main/amd64/74134/docker-desktop.deb --output docker-desktop.deb
sudo apt install ./docker-desktop.deb
And got the error:
E: Invalid archive signature
E: Internal error, could not locate member control.tar{.zst,.lz4,.gz,.xz,.bz2,.lzma,}
E: Could not read meta data from /home/rodolfo/docker-desktop.deb
E: The package lists or status file could not be parsed or opened.
Any ideas?
According to official documentation, and the steps I followed to install docker in Ubuntu 22.04 LTS
Visit the following site https://docs.docker.com/engine/install/ubuntu/
Scroll down until you find the Install using the convenience script section.
You will find the following commands:
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ DRY_RUN=1 sh ./get-docker.sh
the first command will install a shell script with the all needed commands and the other will run this shell script.
You can test the installation by running these commands
$ sudo docker --version
$ sudo docker info
If it looks fine, you now have docker in your machine.
Optional step is to download docker desktop for Ubuntu 22.04
https://docs.docker.com/desktop/linux/install/
MAKE SURE You already installed docker engine before installing docker desktop for Ubuntu
Try moving the DEB file to HOME folder or Change the directory in terminal to the folder where the file is downloaded
So I had the same problem and the solution was to go to the folder root that I downloaded the deb file in it wish is Downloads for me and I rerun the commend
My issue ended up being Ubuntu 22.04 was installed with wsl version 1.
wsl -l -v
NAME STATE VERSION
Ubuntu-22.04 Running 1
wsl --set-version Ubuntu-22.04 2

Ansible Docker containers dynamic inventory on MacOS

I have started a Docker container using the following command:
docker run tomcat:latest
Then I created a file named docker.yml with the following contents:
plugin: community.docker.docker_containers
docker_host: unix://var/run/docker.sock
Finally I try to obtain a list of the currently running Docker containers using:
ansible-inventory -i docker.yml --list
However instead of a list of running containers, I only get the following result:
[WARNING]: * Failed to parse docker.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse docker.yml with constructed plugin: Incorrect plugin name in file: community.docker.docker_containers
[WARNING]: Unable to parse docker.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped"
]
}
}
Have I misunderstood the Ansible Docker containers dynamic inventory or am I doing something wrong?
I suspect I had a case of system in disarray and this was the cure:
I retained my current Python installation located at ~/Library/Python/3.9/.
Attempted to uninstall Ansible using pip:
pip uninstall ansible
Manually removed all things Ansible:
sudo rm -r /etc/ansible
sudo rm -r -/.ansible
sudo rm -r /usr/local/lib/python3.9/site-packages/ansible*
sudo rm /usr/local/bin/ansible*
Performed a fresh installation of Ansible:
pip install ez_setup
pip install --user ansible
Installed Ansible Docker collection prerequisite:
pip install docker
Installed Ansible Docker collection:
ansible-galaxy collection install community.docker
After the above, the Ansible Docker container dynamic inventory works as expected and without errors.

error with dbus and gesettings inside docker container

after using the command RUN apt-get install -y dbus building and then running the container I try to change system proxy with the command gsettings set org.gnome.system.proxy.https host 'proxy-adress' but I get the output failed to commit changes to dconf: Failed to execute child process ?dbus-launch? (No such file or directory). I assume that dbus was not installed so I check the path with whereis dbus but the output is empty. is it uninstalling itself?.

Error /dev/tty: No such device or address when installing sqlcmd inside docker

I wanted to install sql cmd in my docker image.
My dockerfile has these commands to install sqlcmd (centos 7 base image)
RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo
RUN yum remove mssql-tools unixODBC-utf16-devel
RUN yum install -y unixODBC-devel mssql-tools
Below is the docker build logs
Transaction test succeeded
Running transaction
Updating : libcom_err-1.42.9-17.el7.x86_64 1/14
Installing : unixODBC-2.3.7-1.rh.x86_64 2/14
Updating : libss-1.42.9-17.el7.x86_64 3/14
Installing : e2fsprogs-libs-1.42.9-17.el7.x86_64 4/14
Installing : e2fsprogs-1.42.9-17.el7.x86_64 5/14
Updating : 1:openssl-libs-1.0.2k-19.el7.x86_64 6/14
Installing : 1:make-3.82-24.el7.x86_64 7/14
Installing : 1:openssl-1.0.2k-19.el7.x86_64 8/14
/var/tmp/rpm-tmp.8S1dKq: line 17: /dev/tty: No such device or address
error: %pre(msodbcsql17-17.5.2.1-1.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package msodbcsql17-17.5.2.1-1.x86_64
error: msodbcsql17-17.5.2.1-1.x86_64: install failed
/var/tmp/rpm-tmp.tObfQB: line 4: /dev/tty: No such device or address
error: %pre(mssql-tools-17.5.2.1-1.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package mssql-tools-17.5.2.1-1.x86_64
Installing : unixODBC-devel-2.3.7-1.rh.x86_64 11/14
error: mssql-tools-17.5.2.1-1.x86_64: install failed
Cleanup : 1:openssl-libs-1.0.2k-8.el7.x86_64 12/14
Cleanup : libss-1.42.9-10.el7.x86_64 13/14
Cleanup : libcom_err-1.42.9-10.el7.x86_64 14/14
Verifying : libss-1.42.9-17.el7.x86_64 1/14
When i run this installation command manually inside the container's terminal using docker exec then it works fine.
If i run this command directly in a linux machine it works fine.
only when i am building a docker image using docker build i am getting the error /dev/tty: No such device or address
Try:
RUN ACCEPT_EULA=Y yum install -y unixODBC-devel mssql-tools

RStudio in docker image does not deal with some librairies

I have a problem to use the docker rstudio-image rocker/rstudio proposed
on https://www.rocker-project.org/ (docker containers for R). Since I am a beginner with both docker and RStudio, I suspect the problem comes from me and does not deserve a bug report:
I open a proper terminal with 'Docker Quickstart Terminal'
where I run the image with docker run -d -p 8787:8787 -e DISABLE_AUTH=true -v <...>:/home/rstudio/<...> --name rstudio rocker/rstudio
in my browser I then get a nice RStudio instance at the address http://192.168.99.100:8787
but in this instance I can't install several packages such as xml2. I get the message:
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
* deb: libxml2-dev (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘xml2’
* removing ‘/usr/local/lib/R/site-library/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
I don't know whether xml2 is on the image but the file libxml-2.0.pc does exist on my laptop in the directory /opt/local/lib/pkgconfig and pkg-config is in /opt/local/bin. So I tried linking these pkg paths when running
the image (to see what happen when I play with the image environment
in RStudio), adding options -v
/opt/local/lib/pkgconfig:/home/rstudio/lib/pkgconfig -v
/opt/local/bin:/home/rstudio/bin to the run command. But it doesn't work: for some reason
I don't see the content of lib/pkgconfig in RStudio...
Also the RStudio instance does not accept root/sudo commands so I can't
use tools such as apt-get in the RStudio terminal
so, what's the trick ?
Libraries on your laptop (the host for docker) are not available for docker containers. You should create a custom image with required libraries, create a Dockerfile like this:
FROM rocker/rstudio
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libxml2-dev # add any additional libraries you need
CMD ["/init"]
Above I added the libxml2-dev but you can add as many libraries as you need.
Then build your image using this command (you need to execute below command in directory there you created Dockerfile):
docker build -t my_rstudio:0.1 .
Then you can start your container:
docker run -d -p 8787:8787 -e DISABLE_AUTH=true --name rstudio my_rstudio:0.1
(you can add any additional arguments like -v to above).

Resources