首页 > 其他分享 >Docker: common container Dockerfile

Docker: common container Dockerfile

时间:2023-04-14 18:24:21浏览次数:36  
标签:container list apt cd sources && Docker Dockerfile

 

maven

FROM --platform=amd64 maven:3-openjdk-18-slim

RUN cd /etc/apt && > sources.list && cat > sources.list <<EOF
deb https://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main
deb-src https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main
deb https://mirrors.ustc.edu.cn/debian bullseye-updates main
deb-src https://mirrors.ustc.edu.cn/debian bullseye-updates main
EOF

RUN apt update && apt-get install zip git -y

 

Python

FROM --platform=amd64 python:3.11.3-bullseye

RUN cd /etc/apt && > sources.list && cat > sources.list <<EOF
deb https://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main
deb-src https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main
deb https://mirrors.ustc.edu.cn/debian bullseye-updates main
deb-src https://mirrors.ustc.edu.cn/debian bullseye-updates main
EOF

RUN mkdir -pv /etc/xdg/pip && cd /etc/xdg/pip && cat > pip.conf <<EOF
[global]
index-url=http://mirrors.aliyun.com/pypi/simple
extra-index-url=https://pypi.tuna.tsinghua.edu.cn/simple
# proxy=http://user:password@proxy_name:port
timeout=120
trusted-host=mirrors.aliyun.com
quiet=0
verbose=2


[install]
ignore-installed=true
no-compile=false
no-dependencies=false
no-warn-script-location=false


[freeze]
timeout=10
EOF

RUN apt update && apt-get install zip git jq -y && mkdir /root/ansible && pip install ansible
WORKDIR /root

 

标签:container,list,apt,cd,sources,&&,Docker,Dockerfile
From: https://www.cnblogs.com/dissipate/p/17319228.html

相关文章

  • docker nginx
    1,#创建挂载目录mkdir-p/home/nginx/confmkdir-p/home/nginx/logmkdir-p/home/nginx/html 2,#生成容器dockerrun--namenginx-p9001:80-dnginx#将容器nginx.conf文件复制到宿主机dockercpnginx:/etc/nginx/nginx.conf/home/nginx/conf/nginx.conf#将容器c......
  • Docker服务编排 Docker Compose 安装使用
    服务编排:微服务架构的应用系统中一般包含若干个微服务,每个微服务一般都会部署多个实例,如果每个微服务都要手动启停,维护的工作量会很大。•要从Dockerfilebuildimage或者去dockerhub拉取image•要创建多个container•要管理这些container(启动停止删除)服务编排:按照一定......
  • 学习笔记402—Warning: Stopping docker.service, but it can still be activated by:
    执行systemctlstopdocker后提示“Warning:Stoppingdocker.service,butitcanstillbeactivatedby:docker.socket”解释:这是docker在关闭状态下被访问自动唤醒机制,很人性化,即这时再执行任意docker命令会直接启动注:如果真的不希望docker被访问自动唤醒,执行systemct......
  • Docker容器
    Docker容器1.运行容器dockerrun是启动容器的方法。可用三种方式指定容器启动时执行的命令:(1)CMD指令。(2)ENTRYPOINT指令。(3)在dockerrun命令行中指定。例如下面的例子:[root@0x1e61~]#dockerrunubuntupwd/容器启动时执行pwd,返回的/是容器中的当前目录。执行docke......
  • [Docker]容器服务是如何与cgroups协同进行资源控制的?
    Docker利用Linux的控制组(cgroups)来进行资源控制。cgroups是一种内核特性,它允许对资源(例如CPU、内存、磁盘I/O等)进行限制、分配和优先级分配。Docker利用cgroups进行资源限制时,他会通过cgroups为每个容器分配特定的资源配额。这意味着每个容器只能够使用cgroups中指......
  • docker-day4——Dockerfile、docker私有仓库、dockercompose介绍、dockercompose部署f
    目录一、Dockerfile1.1常用和不常用命令1.2dockerfile构建一个djagno项目二、docker私有仓库2.1镜像传到官方仓库2.2镜像分层2.3私有仓库搭建三、dockercompose介绍四、dockercompose部署flask+redis项目4.1新建flask项目app.py4.2编写Dockerfile--》用于构建flask项目的......
  • docker -DockerFile
    1.dockerfile安装,编写我们的镜像来源:1.远程仓库拉取2.用仓库做成的镜像3.把备份的恢复4.使用dockerfile构建Dockerfile是由一系列命令和参数构成的脚本文件,这些命令应用于基础镜像并最终创建一个新的镜像。使用dockerfile不需要先创建容器在里面加东西,而是直接可以在镜像中......
  • docker----day04
    昨日回顾#1容器其他操作 1dockerstart容器id2dockerstop容器id3dockerrm容器id4dockerrm`dockerps-aq`#正在运行的容器不能删除5dockerexec容器id命令6dockercp宿主机目录容器id:容器目录#目录要存在7dockercp......
  • Docker服务器、以及容器设置自动启动
    #一、docker服务设置自动启动###查看已启动的服务systemctllist-units--type=service###查看是否设置开机启动systemctllist-unit-files|grepenable###设置开机启动systemctlenabledocker.service###关闭开机启动systemctldisabledocker.service#二......
  • 【从零开始】Docker Desktop:听说你小子要玩我
    前言......