docker alpine:3.16 root权限安装Anaconda3-2020.07-Linux-x86_64和jdk

首先查看系统版本:

root@fv-az454-287:/tmp# uname -a
Linux fv-az454-287 5.15.0-1046-azure #53~20.04.1-Ubuntu SMP Mon Aug 28 14:17:23 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
root@fv-az454-287:/tmp# grep NA  /etc/os-release 
NAME="Ubuntu"
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
root@fv-az454-287:/tmp# 

拉取并启动镜像

docker pull  alpine:3.16

docker run -itd --name alpine2 alpine:3.16 /bin/sh ;

docker exec -it alpine2 /bin/sh;
#进入alpine 控制台

#  docker stop  alpine2 ;  docker rm  alpine2 ;

修补环境:

apk update  ;


cd /tmp;
#wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub

wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk 
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-bin-2.35-r1.apk 
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-i18n-2.35-r1.apk 

ls -al /usr/glibc-compat/lib/ld* /lib64;

#apk add --allow-untrusted --force-overwrite glibc-2.35-r1.apk glibc-bin-2.35-r1.apk glibc-i18n-2.35-r1.apk

apk add --allow-untrusted --force-overwrite ./glibc*.apk ;

ls -al /usr/glibc-compat/lib/ld* /lib64;

#apk add libc6-compat    ; 

apk add gcompat  ; 

安装

cd /tmp;

wget --no-check-certificate https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh;

sh Anaconda3-2020.07-Linux-x86_64.sh;

# sh Anaconda3-2020.07-Linux-x86_64.sh -u ;

可能产生的错误如下:

Error relocating /root/anaconda3/conda.exe: __strcat_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __snprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vfprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __realpath_chk: symbol not found
/usr/glibc-compat/sbin/ldconfig: /usr/glibc-compat/lib/ld-linux-x86-64.so.2 is not a symbolic link

/tmp # ls -al /usr/glibc-compat/lib/ld* /lib64;
ls: /usr/glibc-compat/lib/ld*: No such file or directory
ls: /lib64: No such file or directory
/tmp #  /tmp # ls -al /usr/glibc-compat/lib/ld* /lib64;
ls: /usr/glibc-compat/lib/ld*: No such file or directory
ls: /lib64: No such file or directory
/tmp #  
/tmp # #apk add --allow-untrusted --force-overwrite glibc-2.35-r1.apk glibc-bin-2.35-r1.apk glibc-i18n-2.35-r1.apk
/tmp #  
/tmp # apk add --allow-untrusted --force-overwrite ./glibc*.apk ;
(1/9) Installing glibc (2.35-r1)
(2/9) Installing ncurses-terminfo-base (6.3_p20220521-r1)
(3/9) Installing ncurses-libs (6.3_p20220521-r1)
(4/9) Installing readline (8.1.2-r0)
(5/9) Installing bash (5.1.16-r2)
Executing bash-5.1.16-r2.post-install
(6/9) Installing libc6-compat (1.2.3-r3)
(7/9) Installing libgcc (11.2.1_git20220219-r2)
(8/9) Installing glibc-bin (2.35-r1)
(9/9) Installing glibc-i18n (2.35-r1)
Executing busybox-1.35.0-r17.trigger
Executing glibc-bin-2.35-r1.trigger
OK: 43 MiB in 23 packages
/tmp #  
/tmp # ls -al /usr/glibc-compat/lib/ld* /lib64;
-rwxr-xr-x    1 root     root        227424 Apr 13 14:27 /usr/glibc-compat/lib/ld-linux-x86-64.so.2

/lib64:
total 8
drwxr-xr-x    2 root     root          4096 Sep 20 09:08 .
drwxr-xr-x    1 root     root          4096 Sep 20 09:08 ..
lrwxrwxrwx    1 root     root            26 Sep 20 09:08 ld-linux-x86-64.so.2 -> /lib/libc.musl-x86_64.so.1
/tmp #  
/tmp # #apk add libc6-compat    ; 
/tmp #  
/tmp # apk add gcompat  ; 
(1/3) Installing musl-obstack (1.2.3-r0)
(2/3) Installing libucontext (1.2-r0)
(3/3) Installing gcompat (1.0.0-r4)
ERROR: gcompat-1.0.0-r4: trying to overwrite lib/ld-linux-x86-64.so.2 owned by glibc-2.35-r1.
Executing glibc-bin-2.35-r1.trigger
1 error; 43 MiB in 26 packages
/tmp # 
[/root/anaconda3] >>> 
PREFIX=/root/anaconda3
Unpacking payload ...
Error relocating /root/anaconda3/conda.exe: __strcat_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __snprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vfprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __realpath_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strdup: symbol not found
Error relocating /root/anaconda3/conda.exe: __stpcpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vsnprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strncpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strcpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __fprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strncat_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strcat_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __snprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vfprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __realpath_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strdup: symbol not found
Error relocating /root/anaconda3/conda.exe: __stpcpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vsnprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strncpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strcpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __fprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strncat_chk: symbol not found
/tmp # apk add libc6-compat    ; 
OK: 56 MiB in 32 packages
/tmp # 



[/root/anaconda3] >>> 
PREFIX=/root/anaconda3
Unpacking payload ...
Error relocating /root/anaconda3/conda.exe: __strcat_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __snprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vfprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __realpath_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strdup: symbol not found
Error relocating /root/anaconda3/conda.exe: __stpcpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vsnprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strncpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strcpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __fprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strncat_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strcat_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __snprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vfprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __realpath_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strdup: symbol not found
Error relocating /root/anaconda3/conda.exe: __stpcpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __vsnprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strncpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strcpy_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __fprintf_chk: symbol not found
Error relocating /root/anaconda3/conda.exe: __strncat_chk: symbol not found
/tmp # apk add gcompat  ; 
(1/3) Installing musl-obstack (1.2.3-r0)
(2/3) Installing libucontext (1.2-r0)
(3/3) Installing gcompat (1.0.0-r4)
ERROR: gcompat-1.0.0-r4: trying to overwrite lib/ld-linux-x86-64.so.2 owned by glibc-2.35-r1.
Executing glibc-bin-2.35-r1.trigger
1 error; 56 MiB in 35 packages
/tmp # 
/tmp # 

jdk就简单了( java version "1.8.0_371" ):

centos7.5免编译安装绿色python3.8和jdk-8u371-linux-x64.tar.gz-CSDN博客

cd /tmp;
wget  https://download.oracle.com/otn/java/jdk/8u371-b11/ce59cff5c23f4e2eaf4e778a117d4c5b/jdk-8u371-linux-x64.tar.gz
 
 
tar -xzvf jdk-8u371-linux-x64.tar.gz ;
ls -al ./jdk1.8.0_371;  
ls -al ./jdk1.8.0_371/jre/bin;
ln  -s /tmp/jdk1.8.0_371/jre/bin/java /bin/java;

参考资料:

百度安全验证icon-default.png?t=N7T8https://baijiahao.baidu.com/s?id=1758431863364826470在Alpine docker容器中运行geckodriver - 编程之家在Alpine docker容器中运行geckodrivericon-default.png?t=N7T8https://www.jb51.cc/faq/891117.html在Alpine docker容器中运行geckodriver - IT屋-程序员软件开发技术分享社区Running geckodriver in an Alpine docker container(在Alpine docker容器中运行geckodriver) - IT屋-程序员软件开发技术分享社区icon-default.png?t=N7T8https://www.it1352.com/1784376.html

你可能感兴趣的:(docker,linux,容器)