Search

250507_1837_M1에 우분투 가상환경 만들기

/Users/ll/aa/dockerfile

# 베이스 이미지 FROM ubuntu:22.04 # 비인터랙티브 모드 설정 ENV DEBIAN_FRONTEND=noninteractive # 필수 패키지 설치 RUN apt-get update && apt-get install -y \ curl \ wget \ git \ build-essential \ lsb-release \ gnupg2 \ software-properties-common \ locales \ && locale-gen en_US.UTF-8 ENV LANG=en_US.UTF-8 ENV LANGUAGE=en_US:en ENV LC_ALL=en_US.UTF-8 # Node.js 설치 RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ apt-get install -y nodejs # Go 설치 RUN wget https://go.dev/dl/go1.20.5.linux-amd64.tar.gz && \ tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz && \ rm go1.20.5.linux-amd64.tar.gz ENV PATH="/usr/local/go/bin:${PATH}" # Rust 설치 RUN curl https://sh.rustup.rs -sSf | bash -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" # ROS 2 Humble 설치 RUN apt update && apt install -y locales && \ locale-gen en_US en_US.UTF-8 && \ update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \ apt install -y software-properties-common && \ add-apt-repository universe && \ apt update && \ apt install -y curl gnupg lsb-release && \ curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \ sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list' && \ apt update && \ apt install -y ros-humble-desktop # ROS 2 환경 설정 RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc # 작업 디렉토리 설정 WORKDIR /workspace
JavaScript
복사

위의 Dockerfile이 있는 디렉토리에서 다음 명령어를 실행하여 이미지를 빌드합니다:

433@123 glory % docker build -t ubuntu22.04-dev . [+] Building 55.0s (5/11) docker:rancher-desktop => [internal] load build definition from dockerfile 0.0s => => transferring dockerfile: 1.65kB 0.0s => [internal] load metadata for docker.io/library/ubuntu:22.04 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [1/8] FROM docker.io/library/ubuntu:22.04 0.0s => [2/8] RUN apt-get update && apt-get install -y curl wget git build-essential lsb-release gnu 53.9s => [3/8] RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs 1.1s
JavaScript
복사