首页 > 其他分享 >dockerfile

dockerfile

时间:2023-03-10 16:56:45浏览次数:37  
标签:RUN -- glibc apk r0 dockerfile 2.25

FROM openjdk:8u191-jdk-alpine3.9 
MAINTAINER ggggg

RUN  echo 'http://mirrors.aliyun.com/alpine/v3.9/main' > /etc/apk/repositories 
RUN  echo 'http://mirrors.aliyun.com/alpine/v3.9/community' >>/etc/apk/repositories 
RUN  apk update --allow-untrusted 
RUN  apk add tzdata --allow-untrusted
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone
RUN apk add --update curl --allow-untrusted
RUN apk add bash --allow-untrusted
RUN apk add curl --allow-untrusted
RUN apk --no-cache add tini --allow-untrusted

RUN apk add --no-cache openssh-server --allow-untrusted
RUN apk add --no-cache openssh-client --allow-untrusted
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
RUN ssh-keygen -t rsa -P "" -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -t ecdsa -P "" -f /etc/ssh/ssh_host_ecdsa_key
RUN ssh-keygen -t ed25519 -P "" -f /etc/ssh/ssh_host_ed25519_key
RUN echo "root:root" | chpasswd
COPY ./glibc/sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub

COPY ./glibc/glibc-2.25-r0.apk /glibc-2.25-r0.apk
RUN apk add glibc-2.25-r0.apk 
#    rm /glibc-2.25-r0.apk

COPY ./glibc/glibc-bin-2.25-r0.apk /glibc-bin-2.25-r0.apk
RUN apk add glibc-bin-2.25-r0.apk 
#    rm /glibc-bin-2.25-r0.apk

COPY ./glibc/glibc-i18n-2.25-r0.apk /glibc-i18n-2.25-r0.apk
RUN apk add glibc-i18n-2.25-r0.apk 
#    rm /glibc-i18n-2.25-r0.apk

# Note that locale -a is not available in alpine linux, use `/usr/glibc-compat/bin/locale -a` instead
COPY ./locale/locale.md /locale.md
RUN cat locale.md | xargs -i /usr/glibc-compat/bin/localedef -i {} -f UTF-8 {}.UTF-8

# Set the lang
ENV LANG=en_US.UTF-8 \
    LANGUAGE=en_US.UTF-8

# Set JAVA Home
RUN echo "export PATH=\$PATH:/usr/lib/jvm/java-1.8-openjdk/bin" >> /etc/profile \
    && source /etc/profile

# Expose 22 port
EXPOSE 22
 
# Retart ssh
CMD [ "/usr/sbin/sshd"]

 

标签:RUN,--,glibc,apk,r0,dockerfile,2.25
From: https://www.cnblogs.com/gaoyuechen/p/17203951.html

相关文章

  • Docker - Dockerfile
    Dockerfile是由一系列指令和参数构成的脚本,一个Dockerfile里面包含了构建整个镜像的完整命令。工作中,由于业务水平与技术选型不同,在使用Docker起服务时,需要定制项......
  • 如何编写正确高效的Dockerfile
    Dockerfile是什么Dockerfile非常普通,它就是一个纯文本,里面记录了一系列的构建指令,比如选择基础镜像、拷贝文件、运行脚本等等,RUN,COPY,ADD指令都会生成一个Layer,而Do......
  • 【Dockerfile】nvm-git-node-centos7镜像
    #依赖centos环境FROMcentos:7#安装vim、git和nvm环境RUNyuminstall-ywget\&&mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.rep......
  • dockerfile
    FROMacicn/jdk:11#时区设置ENVTZ=Asia/Shanghai\DEBIAN_FRONTEND=noninteractiveRUNln-fs/usr/share/zoneinfo/${TZ}/etc/localtime\&&echo${TZ}>/e......
  • 业界可用的基于centos7.9, gcc5.5, cmake3.10.3, boost1.63的docker镜像的dockerFile
    FROMcentos:7.9.2009#InstallbasicdependenciesRUNyum-yinstallgccgcc-c++\gdb\make\valgrind\vim\wget......
  • Dockerfile构建镜像
    一、什么是DockerfileDockerfile用来构建Docker镜像的构建文件,是由一系列命令和参数构成的脚本二、Dockerfile构建镜像过程本文以构建一个eureka单机版服务镜像为例1.......
  • Docker小工具:runlike与whaler(打印容器的启动命令与导出镜像的dockerfile)
    文章目录https://www.codetd.com/article/14504401runlike:通过容器打印出容器的启动命令方法一:直接通过pip方式安装方法二:通过容器方式免安装使用用法whaler......
  • Dockerfile命令详解之 RUN(一)
     语法#该命令以shell形式运行,Linux默认为/bin/sh-c,Windows默认为cmd/S/CRUN<command> 或者#exec格式,由于exec格式会被解析成为json数组,所以,必须使用双引号RUN[......
  • Dockerfile使用技巧(尽量使用非root用户)
    在之前Linux的文章中,小编已经说明了root用户对Linux的重要性。Docker的root权限一直是其遭受诟病的地方,docker的root权限有那么危险吗?我们举个例子假如我们有个用户,叫dem......
  • 重温 dockerfile & docker-compose
    重温dockerfile&dockerCompose复习dockerfile将应用程序及其需要的系统函数库、环境、配置、依赖,打包常用命令https://docs.docker.com/engine/reference/builder/......