mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:44:41 +01:00
Add ubuntu:22.04 docker images (#1618)
Ubuntu 22.04 base image and examples using github, a copy instruction and volumes. I was using this to run examples on a windows machine since it is more comfortable than switching OS or using the WSL subsystem directly. If this is something that other people would like to have I can add other versions of ubuntu and other linux distributions.
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
# Exceptions. See /LICENSE for license information.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Install apt tools:
|
||||
# git: Used by VS Code.
|
||||
# golang: Used for Bazelisk and Buildifier.
|
||||
# python3: For Carbon tools.
|
||||
# gnupg, software-properties-common, wget: For llvm.sh.
|
||||
# apt-get update and install together per Docker best practice.
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
git \
|
||||
gnupg \
|
||||
golang \
|
||||
python3-pip \
|
||||
python3.9 \
|
||||
software-properties-common \
|
||||
wget
|
||||
|
||||
ENV PATH="/root/go/bin:${PATH}"
|
||||
# Bazelisk is used for Carbon builds.
|
||||
RUN go install github.com/bazelbuild/bazelisk@v1.14.0
|
||||
RUN ln -s /root/go/bin/bazelisk /root/go/bin/bazel
|
||||
# Buildifier is used by the Bazel VS Code extension.
|
||||
RUN go install github.com/bazelbuild/buildtools/buildifier@5.1.0
|
||||
|
||||
# Install LLVM from apt.llvm.org.
|
||||
RUN wget https://apt.llvm.org/llvm.sh
|
||||
RUN chmod +x llvm.sh
|
||||
RUN ./llvm.sh 15 all
|
||||
RUN rm llvm.sh
|
||||
# Add the lib dir to the PATH. This helps Bazel find clang and VS Code find
|
||||
# clangd, without version suffixes.
|
||||
ENV PATH="/usr/lib/llvm-15/bin:${PATH}"
|
||||
|
||||
# Update pip and install black and pre-commit.
|
||||
RUN pip3 install -U pip
|
||||
RUN pip3 install black pre-commit
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "carbon-lang",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"dockerfile": "../docker/ubuntu2204/base/Dockerfile",
|
||||
"args": {
|
||||
"TAG": "3.5.6"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user