ldconfig seems no functional under alpine 3.3 - dockerfile

I'm currently install the goczmq (https://github.com/zeromq/goczmq) on golang:1.6.2-alpine docker container, as following:
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.10.tar.gz
wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.10.tar.gz.sig
wget https://download.libsodium.org/jedi.gpg.asc
gpg --import jedi.gpg.asc
gpg --verify libsodium-1.0.10.tar.gz.sig libsodium-1.0.10.tar.gz
tar zxvf libsodium-1.0.10.tar.gz
cd libsodium-1.010.
./configure; make check
sudo make install
sudo ldconfig
The process failed on ldconfig, there seems be a command ldconfig, but I don't think it is actually functional. Any insights? Thank you in advance.

Alpine's version of ldconfig requires you to specify the target folder or library as an argument. Note that alpine has no /etc/ld.so.conf file, nor does it recognize one if you create it.
Example with no target path:
$ docker run -ti alpine sh -c "ldconfig; echo \$?"
1
Example with target path:
$ docker run -ti alpine sh -c "ldconfig /; echo \$?"
0
However, even with that there are frequently linking errors. Others suggest:
Manual symbolic links
Installing glibc into your container.

Related

DockerFiles needed for dpdk pktgen and testpmd images

Hej all,
A new beginner in DPDK world ! I am trying to build a set-up with two k8s pods, one with testpmd and another with pktgen.
As a part of this I need to build Docker images for both the pods, all the DockerFiles from various source are outdated.
If anyone of you have latest Dockerfiles for pktgen and testpmd, please share or point me in right direction.
Thanks !
For instance here, I am using a DockerFile for testpmd image:
FROM ubuntu:latest
RUN apt-get update; \
apt-get -y upgrade; \
apt-get install -y gnupg2 wget lsb-release
ENV DPDK_VER=22.11
ENV DPDK_DIR=/usr/src/dpdk-${DPDK_VER}
WORKDIR /usr/src/
RUN wget http://dpdk.org/browse/dpdk/snapshot/dpdk-22.11.tar.gz
RUN tar -xf dpdk-${DPDK_VER}.tar.gz
ENV RTE_TARGET=x86_64-native-linuxapp-gcc
ENV RTE_SDK=${DPDK_DIR}
WORKDIR ${DPDK_DIR}
RUN sed -i -e 's/EAL_IGB_UIO=y/EAL_IGB_UIO=n/' config/common_linux
RUN sed -i -e 's/KNI_KMOD=y/KNI_KMOD=n/' config/common_linux
RUN sed -i -e 's/LIBRTE_KNI=y/LIBRTE_KNI=n/' config/common_linux
RUN sed -i -e 's/LIBRTE_PMD_KNI=y/LIBRTE_PMD_KNI=n/' config/common_linux
RUN sed -i 's/\(CONFIG_RTE_LIBRTE_MLX5_PMD=\)n/\1y/g' $DPDK_DIR/config/common_base
RUN make install T=${RTE_TARGET} DESTDIR=${RTE_SDK}
WORKDIR ${DPDK_DIR}/app/test-pmd
RUN make
RUN cp testpmd /usr/bin/testpmd
It fails at "sed -i -e 's/EAL_IGB_UIO=y/EAL_IGB_UIO=n/' config/common_linux" as there is no config/common_linux folder in the latest dpdk build.
igb_uio has been remove from dpdk source. You don't need disable that.
And now DPDK has replace the make system with meson and ninja. You can disable drivers and libs with meson setup, for example
meson setup $(dpdk_src_dir) $(dpdk_build_dir) -Ddisable_drivers=net/vmxnet3,baseband/\* -Ddisable_libs=acl,bbdev
So you may need to rewrite the Dockerfile, install meson and ninja, change the configure process with meson.

How to install uWebSockets?

I am running ubuntu on my window 10 through VMware. Because the Udacity course needs uWebSockets to run the simulator.
here is the step the class given to install it:
run chmod a+x install-linux.sh
this is the install-linux.sh file in the same directory
#!/bin/bash
source /etc/os-release || echo 'Warning: /etc/os-release was not found'
if [[ " $ID_LIKE " == *' archlinux '* ]]; then
sudo pacman -S git libuv openssl gcc cmake make
else
if [[ ! " $ID_LIKE " == *' debian '* ]]; then
echo 'Warning: unidentified Linux distribution, assuming Debian-like'
fi
sudo apt-get update
sudo apt-get install git libuv1-dev libssl-dev gcc g++ cmake make
fi
git clone https://github.com/uWebSockets/uWebSockets
cd uWebSockets
git checkout e94b6e1
mkdir build
cd build
cmake ..
make
sudo make install
cd ../..
sudo ln -s /usr/lib64/libuWS.so /usr/lib/libuWS.so
sudo rm -r uWebSockets
But when I try the command in the terminal, nothing happened.
Is anybody can provide some help?
All chmod a+x install-linux.sh does is change the file permissions of install-linux.sh so that it is executable. So I wouldn't expect to see anything in the terminal.
I expect that after changing the file permissions that you are supposed to run the script like this
./install-linux.sh

Deploying a Geodjango Application on AWS Elastic Beanstalk

I'm trying to deploy a geodjango application on AWS Elastic Beanstalk. The configuration is 64bit Amazon Linux 2017.09 v2.6.6 running Python 3.6. I am getting this error when trying to deploy:
Requires: libpoppler.so.5()(64bit) Error: Package: gdal-java-1.9.2-8.rhel6.x86_64 (pgdg93) Requires: libpoppler.so.5()(64bit)
How do I install the required package? I read through Setting up Django with GeoDjango Support in AWS Beanstalk or EC2 Instance but I am still getting problems. My ebextensions currently looks like:
commands:
01_yum_update:
command: sudo yum -y update
02_epel_repo:
command: sudo yum-config-manager -y --enable epel
03_install_gdal_packages:
command: sudo yum -y install gdal gdal-devel
packages:
yum:
git: []
postgresql95-devel: []
gettext: []
libjpeg-turbo-devel: []
libffi-devel: []
I'm going to answer my own question for the sake my future projects and anyone else trying to get started with geodjango. Updating this answer as of July 2020
Create an ebextensions file to install GDAL on the EC2 instance at deployment:
01_gdal.config
commands:
01_install_gdal:
test: "[ ! -d /usr/local/gdal ]"
command: "/tmp/gdal_install.sh"
files:
"/tmp/gdal_install.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
# Geos
cd /
sudo mkdir -p /usr/local/geos
cd usr/local/geos/geos-3.7.2
sudo wget geos-3.7.2.tar.bz2 http://download.osgeo.org/geos/geos-3.7.2.tar.bz2
sudo tar -xvf geos-3.7.2.tar.bz2
cd geos-3.7.2
sudo ./configure
sudo make
sudo make install
sudo ldconfig
# Proj4
cd /
sudo mkdir -p /usr/local/proj
cd usr/local/proj
sudo wget -O proj-5.2.0.tar.gz http://download.osgeo.org/proj/proj-5.2.0.tar.gz
sudo wget -O proj-datumgrid-1.8.tar.gz http://download.osgeo.org/proj/proj-datumgrid-1.8.tar.gz
sudo tar xvf proj-5.2.0.tar.gz
sudo tar xvf proj-datumgrid-1.8.tar.gz
cd proj-5.2.0
sudo ./configure
sudo make
sudo make install
sudo ldconfig
# GDAL
cd /
sudo mkdir -p /usr/local/gdal
cd usr/local/gdal
sudo wget -O gdal-2.4.4.tar.gz http://download.osgeo.org/gdal/2.4.4/gdal-2.4.4.tar.gz
sudo tar xvf gdal-2.4.4.tar.gz
cd gdal-2.4.4
sudo ./configure
sudo make
sudo make install
sudo ldconfig
As shown, the script checks whether gdal already exists using the test function. It then downloads the Geos, Proj, and GDAL libraries and installs them in the usr/local directory. At the time of writing this, geodjango (Django 3.0) supports up to Geos 3.7, Proj 5.2 (which also requires projdatum. Current releases do not require it), and GDAL 2.4 Warning: this installation process can take a long time. Also I am not a Linux professional so some of those commands may be redundant, but it works.
Lastly I add the following two environment variables to my Elastic Beanstalk configuration:
LD_LIBRARY_PATH: /usr/local/lib:$LD_LIBRARY_PATH
PROJ_LIB: usr/local/proj
If you still have troubles I recommend checking the logs and ssh-ing in the EC2 instance to check that installation took place. Original credit to this post

libsodium.so.23 when using SSR in ubuntu 16

I'm trying to use shadowsocksR in my ubuntu 16 .
sudo apt-get install git
git clone -b manyuser https://github.com/shadowsocksr-backup/shadowsocksr.git
cd shadowsocksr/shadowsocks
python local.py -s server_ip -p server_port -k password -m chacha20-ietf -o tls1.2_ticket_auth
then he said " libsodium not found" so I install libsodium
download the LATEST.tar.gz from https://download.libsodium.org/libsodium/releases/
tar -zxf LATEST.tar.gz
cd libsodium-stable
./configure
make && make check
sudo make install
```
but this time
python local.py -s server_ip -p server_port -k password -m chacha20-ietf -o tls1.2_ticket_auth
He said OSError: libsodium.so.23: cannot open shared object file: No such file or directory
thankyou for your help
You need to install libsodium-dev
Try running "apt-get install libsodium-dev"
If you've compiled libsodium, make sure libsodium is in the linker cache:
ldconfig -p | grep libsodium
If there is no output, chances are that the linker cache is not updated in time.
You can update the cache by:
sudo ldconfig

Fastest way to install Tesseract on Elastic Beanstalk

I am currently using Tika to extract text from files uploaded to my Rails app running on AWS Elastic Beanstalk (64bit Amazon Linux 2016.03 v2.1.2 running Ruby 2.2). I'd like to index scanned images as well, so I need to install Tesseract.
I was able to get it to work by installing it from source like so, but it added 10 minutes to my deploys to a fresh instance. Is there a faster way to do this?
.ebextensions/02-tesseract.config
packages:
yum:
autoconf: []
automake: []
libtool: []
libpng-devel: []
libtiff-devel: []
zlib-devel: []
container_commands:
01-command:
command: mkdir -p install
cwd: /home/ec2-user
02-command:
command: cp .ebextensions/scripts/install_tesseract.sh /home/ec2-user/install/
03-command:
command: bash install/install_tesseract.sh
cwd: /home/ec2-user
.ebextensions/scripts/install_tesseract.sh
#!/usr/bin/env bash
cd_to_install () {
cd /home/ec2-user/install
}
cd_to () {
cd /home/ec2-user/install/$1
}
if ! [ -x "$(command -v tesseract)" ]; then
# Add `usr/local/bin` to PATH
echo 'pathmunge /usr/local/bin' > /etc/profile.d/usr_local.sh
chmod +x /etc/profile.d/usr_local.sh
# Install leptonica
cd_to_install
wget http://www.leptonica.org/source/leptonica-1.73.tar.gz
tar -zxvf leptonica-1.73.tar.gz
cd_to leptonica-1.73
./configure
make
make install
rm -rf /home/ec2-user/install/leptonica-1.73.tar.gz
rm -rf /home/ec2-user/install/leptonica-1.73
# Install tesseract ~ the jewel of Odin's treasure room
cd_to_install
wget https://github.com/tesseract-ocr/tesseract/archive/3.04.01.tar.gz
tar -zxvf 3.04.01.tar.gz
cd_to tesseract-3.04.01
./autogen.sh
./configure
make
make install
ldconfig
rm -rf /home/ec2-user/install/3.04.01.tar.gz
rm -rf /home/ec2-user/install/tesseract-3.04.01
# Install tessdata
cd_to_install
wget https://github.com/tesseract-ocr/tessdata/archive/3.04.00.tar.gz
tar -zxvf 3.04.00.tar.gz
cp /home/ec2-user/install/tessdata-3.04.00/eng.* /usr/local/share/tessdata/
rm -rf /home/ec2-user/install/3.04.00.tar.gz
rm -rf /home/ec2-user/install/tessdata-3.04.00
fi
Short answer
.ebextensions/02-tesseract.config
commands:
01-libwebp:
command: "yum --enablerepo=epel --disablerepo=amzn-main -y install libwebp"
02-tesseract:
command: "yum --enablerepo=epel -y install tesseract"
Long answer
I'm not familiar with non-Ubuntu package managers or ebextensions, so after some digging, I found that there are precompiled binaries that can be installed on Amazon Linux in the stable EPEL repo.
The first obstacle was figuring out how to use the EPEL repo. The easiest way is to use the enablerepo option on the yum command.
That gets us here:
yum --enablerepo=epel install tesseract
Next, I had to resolve this dependency error:
[root#ip-10-0-1-193 ec2-user]# yum install --enablerepo=epel tesseract
Loaded plugins: priorities, update-motd, upgrade-helper
951 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package tesseract.x86_64 0:3.04.00-3.el6 will be installed
--> Processing Dependency: liblept.so.4()(64bit) for package: tesseract-3.04.00-3.el6.x86_64
--> Running transaction check
---> Package leptonica.x86_64 0:1.72-2.el6 will be installed
--> Processing Dependency: libwebp.so.5()(64bit) for package: leptonica-1.72-2.el6.x86_64
--> Finished Dependency Resolution
Error: Package: leptonica-1.72-2.el6.x86_64 (epel)
Requires: libwebp.so.5()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I found the solution here
Just adding the epel repo doesn't solve it, as the packages in the
amzn-main repository seem to overrule those in the epel repository. If
the libwebp package in the amzn-main repo are excluded it should work
The Tesseract install has some dependencies found in the amzn-main repo. This is why I first install libwebp with --disablerepo=amzn-main.
yum --enablerepo=epel --disablerepo=amzn-main install libwebp
yum --enablerepo=epel install tesseract
Finally, here's how you can install yum packages on Elastic Beanstalk with options:
.ebextensions/02-tesseract.config
commands:
01-libwebp:
command: "yum --enablerepo=epel --disablerepo=amzn-main -y install libwebp"
02-tesseract:
command: "yum --enablerepo=epel -y install tesseract"
Fortunately, this is also the easiest way to install Tesseract on Elastic Beanstalk!