Installing python3 python3-pip and awscli on elasticsearch_exporter container - linux

I am trying to install following packages on elasticsearch_exporter container.
I tried yuminstall and apt-get and could not install using them.
Can someone tell how to install packages on this container?
Linux elasticsearch-exporter-6dbd9cf659-7km8x 5.2.9-1.el7.elrepo.x86_64 #1 SMP Fri Aug 16 08:17:55 EDT 2019 x86_64 GNU/Linux
Error:
apt-get install python3
sh: apt-get: not found
python3
python3-pip
awscli

If you are referring to justwatch/elasticsearch_exporter image, then it is based on busybox image (source). There is no package manager inside and adding one would be rather difficult.
An easy way to solve this is to just copy the exporter into regular Debian image, like this:
FROM justwatch/elasticsearch_exporter:1.1.0 as source
FROM debian:buster-slim
COPY --from=source /bin/elasticsearch_exporter /bin/elasticsearch_exporter
EXPOSE 9114
ENTRYPOINT [ "/bin/elasticsearch_exporter" ]
And here is your exporter with apt inside.

Related

when i install python 3.9 on chromebook with linux penguin i still see the old version

I am not a linux user, so this might be a basic question.
I am trying to upgrade python version from 3.5 to 3.9 on a chromebook.
The chrome book runs linux penguin (i type uname -a to get the version).
Linux penguin 5.4.67-09356-gf3ed4c0c4a31 #1 SMP PREEMPT Sun Sep 27 20:30:52 PDT 2020 aarch64 GNU/Linux
I have tried the following online method (replacing 3.7 for 3.9) but it fails:
https://dev.to/serhatteker/how-to-upgrade-to-python-3-7-on-ubuntu-18-04-18-10-5hab
https://dev.to/serhatteker/how-to-upgrade-to-python-3-7-on-ubuntu-18-04-18-10-5hab
I have tried other online methods too, but they also fail so i now go back to the basics.
I have also tried this method for miniconda:
https://docs.conda.io/en/latest/miniconda.html
for both the 32 and 64 bit versions of python on linux but get the error message:
Miniconda3-latest-Linux-x86_64.sh: line 414: /opt/miniconda3/conda.exe: cannot execute binary file: Exec format error
In particular i note that the new python version is not in the /usr/bin folder, but the old version is.
I therefore do: sudo apt install python3.9 and see the following:
dlefcoe#penguin:~$ sudo apt install python3.9
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'postgresql-plpython3-9.6' for regex 'python3.9'
postgresql-plpython3-9.6 is already the newest version (9.6.20-0+deb9u1).
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
This looks positive, but when i do python it still goes to the old version.
When i type python3.9 the system returns:
-bash: python3.9: command not found
I presume that version 3.9 is installed somewhere (but where i don't know) or i have not installed it properly.
How can i get this working on the chromebook please ?
The following solution works:
Install dependencies
sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
Download latest release
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
extract file
tar -xf Python-3.9.0.tgz
configure script
cd Python-3.9.0
./configure --enable-optimizations
build process
make -j 12
install binaries
sudo make altinstall
And then test the version with python3.9 --version.
The full link is here:
https://linuxize.com/post/how-to-install-python-3-9-on-ubuntu-20-04/
Presumably this will work with later versions too. So 3.9.x.

Python 3.6 in tensorflow gpu docker images

How can I have python3.6 in tensorflow docker images.
All the images I tried (latest, nighty) are using python3.5 and I don't want to modify all my scripts.
The Tensorflow images are based on Ubuntu 16.04, as you can see from the Dockerfile. This release ships with Python 3.5 as standard.
So you'll have to re-build the image, and the Dockerfile will need editing, even though you need to do the actual build with the parameterized_docker_build.sh script.
This answer on ask Ubuntu covers how to get Python 3.6 on Ubuntu 16.04
The simplest way would probably be just to change the From line in the Dockerfile to FROM ubuntu:16.10, and python to python3.6 in the initial apt-get install line
Of course, this may break some other Ubuntu version-specific thing, so an alternative would be to keep Ubuntu 16.04 and install one of the alternative ppa's also listed in the linked answer:
RUN add-apt-repository ppa:deadsnakes/ppa &&
apt-get update &&
apt-get install -y python3.6
Note that you'll need this after the initial apt-get install, because that installs software-properties-common, which you need to add the ppa.
Note also, as in the comments to the linked answer, that you will need to symlink to Python 3.6.
Finally, note that I haven't tried any of this. The may be gotchas, and you may need to make another change to ensure that the correct version of Python is used by the running container.
You can use stable images which are supplied by third parties, like ufoym/deepo.
One that fits TensorFlow, python3.6 and cuda10 can be found here or you can pull it directly using the command docker pull ufoym/deepo:py36-cu100
I use their images all the time, never had problems
With this anwer, I just wanted to specify how I solved this problem (the previous answer of SiHa helped me a lot but I had to add a few steps so that it worked completly).
Context:
I'm using a package (segmentation model for unet++) that requires tensorflow==1.4.0 and keras==2.2.2.
I tried to use the docker image for tensorflow 1.4.0, however, the default version of python of this image is 3.5 which is not compatible with my package.
I managed to install python3.6 on the docker images thanks to the following files:
My Dockerfile contains the following lines:
Dockerfile:
FROM tensorflow/tensorflow:1.4.0-gpu-py3
RUN mkdir /AI_PLATFORM
WORKDIR /AI_PLATFORM
COPY ./install.sh ./install.sh
COPY ./requirements.txt ./requirements.txt
COPY ./computer_vision ./computer_vision
COPY ./config.ini ./config.ini
RUN bash install.sh
Install.sh:
#!/urs/bin/env bash
pip install --upgrade pip
apt-get update
apt-get install -y python3-pip
add-apt-repository ppa:deadsnakes/ppa &&
apt-get update &&
apt-get install python3.6 --assume-yes
apt-get install libpython3.6
python3.6 -m pip install --upgrade pip
python3.6 -m pip install -r requirements.txt
Three things are important:
use python3.6 -m pip instead of pip, else the packages are installed on python 3.5 default version of Ubuntu 16.04
use docker run python3.6 <command> to run your containers with python==3.6
in the requirements.txt file, I had to specify the following things:
h5py==2.10.0
tensorflow-gpu==1.4.1
keras==2.2.2
keras-applications==1.0.4
keras-preprocessing==1.0.2
I hope that this answer will be useful
Maybe the image I created will help you. It is based on the cuda-10.0-devel image and has tensorflow 2.0a-gpu installed.
You can use it as base image for your own implementation. The image itself doesn't do anything. I put the image on dockerhub https://cloud.docker.com/repository/docker/patientzero/tensorflow2.0a-gpu-py3.6
The github repo is located here: https://github.com/patientzero/tensorflow2.0-python3.6-Docker
Pulling it won't do much, but for completeness:
$ docker pull patientzero/tensorflow2.0-gpu-py3.6
edit: changed to general tensorflow 2.0x image.
Also as mentioned here, the official image for the beta 2.0 release now comes with python 3.6 support

How to install JavaPackage on ubuntu

I came across a debian application by the name JavaPackage which can create a debian installation file (.deb) form a java binary (.tar.gz) which you can then install using dpkg -i application_name.deb. With Ubuntu being a debian-based linux distribution, it is possible that it can be installed on ubuntu as well.
How do I go about installing it on Ubuntu/Kubuntu 16.04.2 LTS?
java-package is available in the official ubuntu repositories. All you need to do is update the repository with the latest version then install it as shown below:
sudo apt-get update
sudo apt-get install java-package

Docker - Unable to locate package docker-engine

I am trying to install docker in Ubuntu 16.04. I am following this link for docker installation. I am ending up with Unable to locate package docker-engine
My current kernal version - 4.4.0-38-generic
Ubuntu version - 16.04
The docker package already inside Ubuntu is called docker.io [1] so just do
sudo apt-get install docker.io
But if you follow that link you gave and do steps 7, 8, 9 then your installation will know about the package at the docker repo and also find docker-engine.
Your call. I run the Ubuntu version (currently 0.11.2 on Ubuntu 16.04) on some machines, and the one from Docker on others (as I was curious about some 0.12 features). Both will work just fine.
[1] As docker is used for a desktop launcher application 'docking' icons.
I faced the same issue on AWS-EC2 with ubuntu-18.04 server...
running apt-get update does the trick for me....
Once update runs fine then run apt-get install docker.io
Docker-compose-plugin is put into the docker.io repo.
Running sudo apt install docker.io ,or apt-get in older Ubuntu versions, will also get you the files you need. First you will need to run update to make sure you have most recent versions. sudo apt update
The main solution which solved most of the issues in docker is installing 64-bit version of ubuntu. I was running with 32-bit(i686). Hope it helps ! !
I wasn't able to install docker with the current other solutions but managed to get rid of the "Unable to locate package docker-engine" error with a solution mentioned on the GitHub repo issues (issue of May 31, 2020).
The solution was to run these commands:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

difference between wget and apt get

Im trying to install google's tensor flow API and i'm following their instructions on this link to no avail.
after typing the following command:
sudo apt-get install python-pip python-dev
i get:
sudo: apt-get: command not found
I'm new to Linux and i was told there are tow types, red-hat and a nameless parallel, which answers respectively to either wget or apt-get. I was also told i need to adjust the commands. (wget does works)
is this true? What is the accurate difference between wget and apt-get? how do i adjust the commands to my situation?
i'm working with:
SUSE Linux Enterprise server 11 (x86_64)
release 11
Suse Linux has not installed apt-get by default. you should go with zypper:
zypper install python-devel python-pip
apt-get is a packagemanagment system while wget is only good for filetransfer
apt-get is a package manager for Debian distros while SUSE Linux is equipped with zypper.
You can use:
zypper install python-devel python-pip
You can also compile python without using package manager like zypper. Wget is used to download things and is not a package manager. Thus when you will compile, you'll need the package. So you'll use wget.

Resources