Dockerfile
Dockerfile
FROM ubuntu:22.04
----------------------------------- 安装 cmake -------------------------------------->>
ADD https://cmake.org/files/v3.25/cmake-3.25.2-linux-x86_64.tar.gz /tmp/
WORKDIR /tmpRUN tar -xf cmake-3.25.2-linux-x86_64.tar.gz
RUN cp -rd cmake-3.25.2-linux-x86_64/bin /usr/local/
RUN cp -rd cmake-3.25.2-linux-x86_64/doc /usr/local/
RUN cp -rd cmake-3.25.2-linux-x86_64/share /usr/local/RUN rm -r /tmp/*
WORKDIR /<<---------------------------------- 安装 cmake --------------------------------------
----------------------------------- 切换为源 -------------------------------------->>
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get clean
RUN apt-get update<<--------------------------------- 切换为源 --------------------------------------
RUN apt-get install build-essential -y
Build image
docker build -f ./DockerFile . -t ubuntu22-dev:v1
Run container
docker run -it -d --name ubuntu22 -v workspace:/root/workspace --privileged=true ubuntu22-dev:v1
标签:RUN,x86,64,3.25,linux,cmake,dockerfile
From: https://www.cnblogs.com/litesite/p/dockerfile-zwn7ho.html