RHEL 8 Container MSSQL ODBC Driver e2fsprogs - sql-server

I'm trying to build a custom docker container using the RHEL 8 UBI. As part of this I want to install the MSSQL 17 ODBC driver.
I've followed the steps outlined in Microsofts Documentation here:
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#redhat17
And added the Microsoft repo to my yum.repos.d directory however when I try to build the container I get the following error: nothing provides e2fsprogs needed by msodbcsql17-17.6.1.1-1.x86_64
When I dug a bit further into this it looks as though it looks as though for RHEL-7 Microsoft suggest installing e2fsprogs manually you can see that here: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#offline-installation
This unfortunately isn't possible in RHEL-8 as e2fsprogs-static has been removed: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages
The full output from the build is:
$ docker build -f ./test.dockerfile -t daark:1 .
Sending build context to Docker daemon 25.77MB
Step 1/7 : FROM registry.redhat.io/ubi8/ubi
---> a1f8c9699786
Step 2/7 : RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
---> Using cache
---> 90b3e1514239
Step 3/7 : RUN yum search odbc
---> Using cache
---> b26f78d0da28
Step 4/7 : RUN yum search msodbcsql17
---> Using cache
---> c6f7751b97dc
Step 5/7 : ENV ACCEPT_EULA=Y
---> Using cache
---> 2b0003944673
Step 6/7 : RUN yum install -y unixODBC unixODBC-devel
---> Using cache
---> 1d0b8c594905
Step 7/7 : RUN yum install -y msodbcsql17
---> Running in 67c30e75fb42
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:08:11 ago on Wed Aug 5 09:36:32 2020.
Error:
Problem: cannot install the best candidate for the job
- nothing provides e2fsprogs needed by msodbcsql17-17.6.1.1-1.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
The command '/bin/sh -c yum install -y msodbcsql17' returned a non-zero code: 1
This error is pretty reproducible here is the test dockerfile i'm using to debug
FROM registry.redhat.io/ubi8/ubi
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum search odbc
RUN yum search msodbcsql17
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum install -y msodbcsql17
Has anyone managed to get this ODBC driver installed on an RHEL 8 UBI based container?

I found a work around that I hope will help the next person to hit this.
Rather than running yum install -y msodbcsql17 I instead used yum to download the RPM
yum download -y msodbcsql17
then used rpm -Uvh --nodeps msodbcsql17*rpm to install it.
You can use this docker file:
FROM registry.redhat.io/ubi8/ubi
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum search odbc
RUN yum search msodbcsql17
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum download -y msodbcsql17
RUN rpm -Uvh --nodeps msodbcsql17*rpm

#daark thank you for posting your solution. Your solution got me over the problem I was facing. I ended modifying your solution to the following (in case it helps anyone else):
FROM registry.access.redhat.com/ubi8/python-38
USER root
RUN yum update --assumeyes && \
yum install --assumeyes \
unixODBC-devel \
&& yum clean all
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum download -y msodbcsql17
RUN ACCEPT_EULA=y rpm -Uvh --nodeps msodbcsql17*rpm
I tried to add this to the #daark's solution as a comment, but it was too difficult to display the code properly.
Good luck to anyone else facing this issue 🍀

Latest msodbcsql17 release fixes this issue. The documentation steps work smooth once again. See docs issue

I can confirm that installation on redhat/ubi8 works with msodbcsql17-17.8.1.2-1.x86_64.rpm.
FROM redhat/ubi8
COPY msodbcsql17-17.8.1.2-1.x86_64.rpm /tmp
RUN MSSQL_PID=Developer ACCEPT_EULA=Y yum -y localinstall /tmp/msodbcsql17-17.8.1.2-1.x86_64.rpm; rm /tmp/msodbcsql17-17.8.1.2-1.x86_64.rpm

Related

How to install allure on ubuntu 20 using selenium with python?

I have tried this
sudo apt-add-repository ppa:qameta/allure
sudo apt-get update
sudo apt-get install allure
and get the following results
Reading package lists... Done
Building dependency tree
Reading state information... Done
allure is already the newest version (0.8.3.0-3build3).
The following packages were automatically installed and are no longer required:
gir1.2-dee-1.0 gnome-software-common libaec0 libappstream-glib8 libapt-pkg5.90 libenchant1c2a libfprint0 libgfortran5 libgpod4 libgspell-1-1 libisl21 liblouis17 liboauth0 libqt5script5 librsync2
libwxgtk3.0-0v5 libx265-176 libxmlb1 python3-markupsafe python3-monotonic shim syslinux-legacy
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
version of allure it gives no command found
allure --version
allure: command not found
I had the exact same problem and this solved it for me:
Credit -> allure: command not found on linux
The solution in just three steps:
sudo apt-get install default-jre
wget https://github.com/allure-framework/allure2/releases/download/2.18.1/allure_2.18.1-1_all.deb
sudo dpkg -i allure_2.18.1-1_all.deb

How to install ROS on Ubuntu 18.04?

Im running Ubuntu 18.04 and trying to install ROS for the first time on my machine. I have tried to follow the instructions at: http://wiki.ros.org/melodic/Installation/Ubuntu
I get stuck at this part.
sudo apt-get install ros-melodic-desktop-full
My attempts:
sudo apt -f install
sudo apt update --fix-missing
sudo dpkg --configure -a
sudo dpkg --remove --force-remove--reinstreq
sudo apt clean
sudo apt update
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
Nothing has worked so far.
Terminal commands:
$sudo apt-get install ros-melodic-desktop-full
Reading package lists… Finished
Builds dependency trees
Reading state information ... Finished
Some packages could not be installed. It may mean that you have requested
an impossible situation or, if you use the unstable distribution
that some necessary packages have not yet been created or moved
from "Incoming".
The following information may help to resolve the situation:
The following packages have dependencies that cannot be satisfied:
rose-melodic-desktop-full: Dependent on: rose-melodic-desktop but it will not be installed
Depending on: rose-melodic-perception but it will not be installed
Depending on: rose-melodic-simulators but it will not be installed
Depending on: ros-melodic-urdf-sim-tutorial but it will not be installed
E: Could not correct the problems, you have withheld broken packages.
Please help me install ROS
1 - After following ROS melodic Installation first steps (see link below), Try to install it with the link "click here" below the "sudo apt install ros-melodic-desktop-full" line
ROS melodic Installation page
If it's doesn't work
2 - check, "Software & Update" parameters
(if you cannot find it: launch "Ubuntu Software Center" and in the menu bar, on top, select "Software & Update")
In "Other Sofware" tab, the link
"http://pacckage.ros.org/ros/ubuntu bionic main"
is printed, and in "Autentication" tab a key from Open Robotics is printed
3 - Try to do 1- again, if it doesn't work, follow 4-
4 - In "Updates" tab, check "recommanded Updates", launch "Update Manager" and install updates (I don't do it properly on my PC)
5 - And finally you need to install manually rosdep with:
"sudo apt-get install python-rosdep"
Ubuntu (apt) does NOT allow packages with the same name but different versions to be installed.
Remove other versions first. For example: apt remove ros-desktop*
first of all install program on ubuntu.
sudo apt-get update
sudo apt-get upgrade
after update packet try follow the instructions at: enter link description here again
I got it working like so:
Install deps:
sudo apt install gazebo9-common libgazebo9-dev gazebo9 ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-dev ros-melodic-gazebo-ros-control ros-melodic-gazebo-ros ros-melodic-urdf-sim-tutorial ros-melodic-simulators
Install ros melodic
sudo apt-get install ros-melodic-desktop-full

Install Adminer on Ubuntu 18.04 bionic

I'm trying to install Adminer from Ubuntu repository using:
sudo apt install adminer
Installation works fine but can't find the file /etc/adminer/apache.conf to use with Apache server. The folder /etc/adminer/ is empty and can't find it anywhere with find command.
Any help?
Thanks in advance.
In the next few steps, I'll show you how I installed adminer for Ubuntu 18.04.1 LTS .
After installation with apt package manager change into the adminer directory.
cd /usr/share/adminer
There you will find a file called compile.php.
Run the following command and the adminer-X.X.X.php (X.X.X for your version) file will be created.
sudo php compile.php
Create the apache adminer configuration file.
sudo echo "Alias /adminer.php /usr/share/adminer/adminer-X.X.X.php" | sudo tee /etc/apache2/conf-available/adminer.conf
Now you'll need to activate the configuration.
cd /etc/apache2/conf-available/
sudo a2enconf adminer.conf
Reload your apache webserver.
sudo systemctl reload apache2.
Test in your browser of choice (localhost/adminer.php)
This source was really helpful:
https://www.linuxhelp.com/how-to-install-adminer-on-ubuntu-16-04/
Install Apache:
sudo apt-get install apache2
Install PHP:
sudo apt-get install php libapache2-mod-php php-mysql
Install Adminer:
sudo wget "http://www.adminer.org/latest.php" -O /var/www/html/adminer.php
Once the installation completes, restart Apache.
sudo service apache2 restart
At this point, the setup is complete. You can access Adminer at the following address.
http://[SERVER_IP]/adminer.php

Access external SQL server from inside of Docker

I am having a really hard time getting my docker container to access the MS SQL server. I have tried following this guide here, but to no avail.
Here is my Base Dockerfile:
FROM python:3
ADD ./odbcinst.ini /etc/odbcinst.ini
RUN apt-get update && apt-get install gcc
RUN apt-get install -y tdsodbc unixodbc-dev
RUN apt-get install unixodbc-bin -y
RUN apt-get clean -y
RUN apt-get update && apt-get install -y gcc unixodbc-dev mssql-python-pyodbc
RUN pip install pyodbc
RUN pip install plaster_pastedeploy pyramid pyramid_jinja2 pyramid_debugtoolbar waitress yagmail pyodbc
And here is the other docker file that extends it:
FROM pyodbc
COPY . .
RUN pip install -e companalysis/
CMD [ "pserve", "companalysis/development.ini" ]
EXPOSE 8081
and here is my sql connection string:
strconn = 'DRIVER=
{FreeTDS};SERVER=192.168.0.6;
DATABASE=xxxx;UID=xxxx;PWD=xxx'
and no matter what I do I get this error:
Error: ('01000', u"[01000] [unixODBC][Driver Manager]Can't open lib 'FreeTDS' : file not found (0) (SQLDriverConnect)")
I would love some assistance on this.
EDIT: I have gotten it to install with this in my dockerfile:
I got it to properly install the driver with this in my dockerfile:
RUN echo "[FreeTDS]\n\
Description = FreeTDS unixODBC Driver\n\
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so\n\
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so" >> /etc/odbcinst.ini
RUN export PYMSSQL_BUILD_WITH_BUNDLED_FREETDS=1
RUN apt-get update && apt-get install -y unixodbc unixodbc-dev freetds-dev freetds-bin tdsodbc
I solved this issue by editing /etc/odbcinst.ini like so:
RUN echo "[FreeTDS]\n\
Description = FreeTDS unixODBC Driver\n\
Driver = /usr/lib/arm-linux-gnueabi/odbc/libtdsodbc.so\n\
Setup = /usr/lib/arm-linux-gnueabi/odbc/libtdsS.so" >> /etc/odbcinst.ini
Paths to libtdsodbc.so and libtdsS.so might be different depending on your architechture, as already pointed out in the linked questions.
If in doubt about the paths run the docker container, get into it (docker exec -ti <hash> bash) and search for the correct path.
Depending on your OS and architecture you could also use the Microsoft ODBC driver instead of the FreeTDS driver. For detailed instructions see the docs.

Unable to locate package matlab-psychtoolbox-3

I am trying to install the matlab-psychtoolbox-3 and I recieve this error:
$ sudo apt-get install matlab-psychtoolbox-3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package matlab-psychtoolbox-3
Can anybody tell me how to solve the problem?
I guess this is old, but for anyone struggling with this error while installing psych-toolbox this is how to solve it. Basically, the error is because the neurodebian package is not installed in your system. To do so, run: sudo apt-get install neurodebian
Once you do this, then follow the next step, i.e., sudo apt-get install matlab-psychtoolbox-3
Then you are all set.
assuming that you've added the neurodebian ppa to your system witch is the easyest way to get the psychtoolbox to ubuntu
try to update your packet list with sudo apt-get update and then try to install again with sudo apt-get install matlab-psychtoolbox-3
if that doesn’t help check your software sources and see if the neurodebian nonfree ppa is installed (all matlab stuff is part of the nonfree branch).
if you got the free branch installed remove it put add the non free branch:
wget -O- http://neuro.debian.net/lists/trusty.de-md.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 2649A5A9
that should do the trick

Resources