I already install krb5-devel and confirm krb5-config command is present but when installing gssapi I got krb5-config not found - containers

I have a container file that uses the base image of fedora 37. I want to install some python libraries and some of them require gssapi. I know that gssapi requires krb5-devel. I have a step to install that and I can confirm that it works by calling krb5-config. However, while building the container (using Kaniko) it hit the issue of incompleted installation of gssapi because krb5-config was not found.
I could build my container fine locally using podman/buildar but when pushing my code to GitLab and using Kaniko to build the container, it failed. I doubt if it is because of Kaniko.
Here is my container file:
FROM fedora:37
USER root
WORKDIR /opt/workspace
RUN dnf install -y createrepo_c \
krb5-devel \
python3-pip \
python3-devel \
tree \
diffutils \
git \
gcc
RUN krb5-config
COPY *requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt -r test_requirements.txt
I also tried to install heimdal-devel and did the symblink RUN ln -s /usr/bin/heimdal-krb5-config /usr/bin/krb5-config but it doesn't help at all.

Related

different pdf views on different softwares: vs studio code, chrome and acrobat reader, after imagemagick tif -> pdf convertion

I'm converting a tif file to pdf with imagemagick:
Imagemagick version: 7.1.0-13
Imagemagick command: magick convert -density 80 -page a4 -limit map 3GB -limit memory 3GB tiff:- pdf:-
This has been working good until meeting this guy:
https://drive.google.com/file/d/1AJjN8F2RoKViE56ZE7I9XDYTJ-HefUaA/view
Which converted it to this pdf:
https://drive.google.com/file/d/1C3Dfd7fGvgJFqJwKbOoLPB-om80gc3PP/view
Now if you view the result on a browser, like chrome, you see multiple empty pages:
However opening the file with adobe reader I get this instead:
And what it's weird, with vs studio, the file looks good:
For viewing the pdf on visual studio I'm using this extension:
Now the question is, how do I fix this?
[edited]
Even after upgrading the library it doesn't work, maybe missing dependency?
OP: debian
DockerFile building the image:
FROM debian
WORKDIR /usr/src/app
RUN apt-get update -qq &&\
apt-get install -y -qq \
chrpath debhelper dh-exec dpkg-dev g++ ghostscript gsfonts libbz2-dev \
libdjvulibre-dev libexif-dev libfftw3-dev libfontconfig1-dev libfreetype6-dev \
libjpeg-dev liblcms2-dev liblqr-1-0-dev libltdl-dev liblzma-dev libopenexr-dev \
libpango1.0-dev libperl-dev libpng-dev librsvg2-bin librsvg2-dev libtiff-dev libwebp-dev \
libwmf-dev libx11-dev libxext-dev libxml2-dev libxt-dev pkg-config pkg-kde-tools zlib1g-dev
RUN apt-get install wget
# Install ImageMagick Platform-independent build dependencies
RUN apt-get update -qq &&\
apt-get install -y -qq \
doxygen doxygen-latex graphviz jdupes libxml2-utils xsltproc
# Install and Configure ImageMagick
RUN wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.0-28.tar.gz -P /opt
RUN tar xvf /opt/7.1.0-28.tar.gz -C /opt
RUN /opt/ImageMagick-7.1.0-28/configure --with-modules --enable-shared
RUN make -j 2 /opt/ImageMagick-7.1.0-28
RUN make install /opt/ImageMagick-7.1.0-28/
RUN make distclean
RUN ldconfig /usr/local/lib
RUN rm /opt/7.1.0-28.tar.gz
[edited 2]
libtiff version: 4.2.0-1
In IM 7, use magick not magick convert. Add +repage after reading the TIFF
magick input2.tif[0] +repage -density 80 -page a4 input2.pdf
works fine for me on IM 7.1.0.28 Q16 Mac OSX Sierra.
It was ImageMagick's bug.
They fixed it on the new version https://github.com/ImageMagick/ImageMagick/issues/5256#event-6929844600

Unable to run chromedp in docker

I had installed chromedp locally using this usual way:-
$ go get -u github.com/chromedp/chromedp. I am able to run it locally but when I deployed it to my stage environment, I got below error:-
exec: \"google-chrome\": executable file not found in $PATH
What changes do I need to make in my dockerfile?
Note: I have already tried adding below code in my Dockerfile as suggested in this answer, still doesn't work
RUN apk update && apk upgrade && apk add --no-cache bash git && apk add --no-cache chromium
# Installs latest Chromium package.
RUN echo #edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
&& echo #edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
&& apk add --no-cache \
harfbuzz#edge \
nss#edge \
freetype#edge \
ttf-freefont#edge \
&& rm -rf /var/cache/* \
&& mkdir /var/cache/apk
RUN go get github.com/mafredri/cdp
CMD chromium-browser --headless --disable-gpu --remote-debugging-port=9222 --disable-web-security --safebrowsing-disable-auto-update --disable-sync --disable-default-apps --hide-scrollbars --metrics-recording-only --mute-audio --no-first-run --no-sandbox```
It took me a while to figure out this problem originally, it's not just you.
When your installing chromedp on your local machine it's grabbing the package and building for that specific distro. When you run it inside docker you need to download a specific chromium build for the distro you are running inside docker. This is because deb is different than rpm is different than alpine and you need to have the right chromium.
Here is a copy of my docker file using a basic linux distro
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub |
apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >>
/etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get -y install google-chrome-stable
RUN chrome &
WORKDIR /app/svc/worker
RUN go build -o main .
EXPOSE 6061
CMD ["./main"]
This version for Alpine might work https://pkgs.alpinelinux.org/packages?name=chromium&branch=v3.10. However, in my experience it is best not to go with a minimal distro because chrome might depend on features not included in alpine.

Docker Alpine: Error loading MySQLdb module

I am building an Alpine based image of a Django application with MariaDB and I can't figure out which dependency I should add to my Dockerfile so that my app could properly connect to the DB.
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
Well, I thought I did. From what I read in this article, in this discussion, mariadb-dev is in Alpine the equivalent of default-libmysqlclient-dev in Debian based system. Furthermore, the mysql-client package in Alpine is merely a dummy package (containing mariadb-dev, mariadb-client, etc etc). Here is the Dockerfile:
# pull official base image
FROM python:3.7-alpine
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# set work directory
WORKDIR /usr/src/cms
# install mysqlclient
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add --no-cache mariadb-dev\
&& apk del build-deps
# install dependencies
RUN pip install --upgrade pip
RUN pip install pipenv
COPY ./Pipfile /usr/src/cms/Pipfile
RUN pipenv install --skip-lock --system --dev
# copy entrypoint.sh
COPY ./entrypoint.sh /usr/src/cms/entrypoint.sh
# copy project
COPY . /usr/src/cms/
# run entrypoint.sh
ENTRYPOINT ["/usr/src/cms/entrypoint.sh"]
I tried to add mariadb-client, to use mysql-client instead.
I also tried to add RUN pip install django-mysql. Nothing seems to change. I successfully build Postgres Django apps without any problem but, when it comes to MySQl vs MariaDB // Debian vs Alpine, I feel confused. Any insight?
It seems you're missing the MySQLdb Python module, for which you should install the mysqlclient Python package: pip install mysqlclient.
On Alpine, pip will build mysqlclient from source, so you'll need gcc and musl-dev for this setup step, hence you'll need to postpone apk del build-deps to after Python modules are installed.
Fixed Dockerfile snippet:
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add --no-cache mariadb-dev
...
RUN pip install mysqlclient
RUN apk del build-deps
Mainly you need to install mariadb-connector-c-dev package. But only this package will give compilation errors. So additionally you will need to add gcc and musl-dev packages into Dockerfile. This will make Django and MySQL work within alpine image.
FROM python:3.8-alpine
RUN apk add gcc musl-dev mariadb-connector-c-dev

Installation Requirements for mysql with DBIish on rakudo-star docker image

I was creating an own docker image based on the latest rakudo-star docker image. I wanted to use DBIish to connect to a mysql database. Unfortunately I am not able to get the DBDish::mysql to work.
I've installed default-libmysqlclient-dev as you can see in
# find / -name 'libmysqlclient*.so'
/usr/lib/x86_64-linux-gnu/libmysqlclient_r.so
/usr/lib/x86_64-linux-gnu/libmysqlclient.so
The error i am facing is:
# perl6 -Ilib -e 'use DBDish::mysql; DBDish::mysql.connect()'
Cannot locate native library 'mysqlclient': mysqlclient: cannot open shared object file: No such file or directory
in method setup at /usr/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 289
in method CALL-ME at /usr/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 539
in method connect at /root/DBIish/lib/DBDish/mysql.pm6 (DBDish::mysql) line 12
in block <unit> at -e line 1
Short answer: you need the package libmysqlclient20 (I added the documentation request to a similar DBIish issue). Debian 9 (stable at the moment) uses and older version than Ubuntu 18.04 (stable at the moment) and Debian Unstable. It also refers to mariadb instead of mysql. Pick libmariadbclient18 on images based on Debian Stable and create a link with the mysql name (see below).
On Debian Testing/Unstable and recent derivatives:
$ sudo apt-get install libmysqlclient20
$ dpkg -L libmysqlclient20
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.9
/usr/share
/usr/share/doc
/usr/share/doc/libmysqlclient20
/usr/share/doc/libmysqlclient20/NEWS.Debian.gz
/usr/share/doc/libmysqlclient20/changelog.Debian.gz
/usr/share/doc/libmysqlclient20/copyright
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20
On Debian 9 and derivatives:
$ dpkg -L libmariadbclient18
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libmariadbclient.so.18.0.0
/usr/lib/x86_64-linux-gnu/mariadb18
/usr/lib/x86_64-linux-gnu/mariadb18/plugin
/usr/lib/x86_64-linux-gnu/mariadb18/plugin/client_ed25519.so
/usr/lib/x86_64-linux-gnu/mariadb18/plugin/dialog.so
/usr/lib/x86_64-linux-gnu/mariadb18/plugin/mysql_clear_password.so
/usr/share
/usr/share/doc
/usr/share/doc/libmariadbclient18
/usr/share/doc/libmariadbclient18/changelog.Debian.gz
/usr/share/doc/libmariadbclient18/copyright
/usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
Create the link:
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
In order to illustrate this, I created an Ubuntu 18.04 container for the occasion*:
docker run -ti --rm --entrypoint=bash rakudo/ubuntu-amd64-18.04
And the abbreviated commands and output:
# apt-get install -y libmysqlclient20 build-essential
# zef install DBIish
# perl6 -e 'use DBDish::mysql; DBDish::mysql.connect()'
Cannot look up attributes in a DBDish::mysql type object
[...]
The error is because I didn't pass the correct parameters for connect as I didn't have a db running. The important thing is that no .so file is missing.
*: I uploaded it to the Docker Hub, a normal run will put you right in the REPL:
$ docker run -ti --rm rakudo/ubuntu-amd64-18.04
To exit type 'exit' or '^D'
>
(I didn't use the Star image when debugging, but it does not matter because this is a more generic problem.)

Unable to run startup script when creating instance on Google Cloud Platform

I have a simple startup script which looks like so:
#!/usr/bin/env bash
sudo apt update
sudo apt install -y ruby-full ruby-bundler build-essential
And create VM instance on GCP like so:
$ gcloud compute instances create test-app --boot-disk-size=10GB --image-family ubuntu-1604-lts --image-project=ubuntu-os-cloud --machine-type=g1-small --zone europe-west1-b --tags test-server --restart-on-failure --metadata-from-file startup-script=startup.sh
My startup.sh is executable. I set its rights like so:
$ chmod +x startup.sh
When however I enter the shell of my newly created instance and check bundler:
test-app:~$ bundle -v
I get these messages:
The program 'bundle' is currently not installed...
So, what is wrong with that and how can I fix it? PS. If I run all my commands just from inside the instance shell, it's all ok, so there is some problem with using startup script on GCP.
I tested with your use case, But the bundle package was installed without making any changes.
Output:
bundle -v
Bundler version 1.11.2
You can check VM serial console log output to verify if start-up script ran. Check the VM instance to verify if the package is installed using the commands below:
sudo apt list --installed | grep -i bundle
sudo egrep bundle /var/log/dpkg.log
In addition, check the gem list bundle