Remove docker and devcontainer as unused (#5500)

As far as I'm aware, the the devcontainers aren't in frequent use, which
is why they fall out of date. Comparing with
https://github.com/llvm/llvm-project/, I don't see devcontainer configs
maintained as part of llvm
(https://github.com/llvm/llvm-project/issues?q=devcontainer doesn't have
much either) so I think we should trim these instead of investing in
maintenance.

These configs aren't being maintained. In the docker configs, note `RUN
bazel build //explorer` is broken. Also, #5496 noted the clang version
is out of date.

Closes #5496
This commit is contained in:
Jon Ross-Perkins
2025-05-20 00:24:19 +00:00
committed by GitHub
parent 27d0d26739
commit 94d4ba682d
6 changed files with 0 additions and 182 deletions
-36
View File
@@ -1,36 +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
{
"name": "carbon-lang",
"build": {
"dockerfile": "../docker/ubuntu2404/base/Dockerfile"
},
"mounts": [
{
"source": "carbon-cache",
"target": "/home/ubuntu/.cache",
"type": "volume"
}
],
"containerUser": "ubuntu",
"remoteUser": "ubuntu",
// When using devcontainer with podman, you may see /workspace being owned
// by root. To work around this, uncomment the following lines
// "runArgs": [
// "--userns=keep-id"
// ],
"customizations": {
"vscode": {
"extensions": [
"bazelbuild.vscode-bazel",
"bierner.github-markdown-preview",
"daohong-emilio.yash",
"esbenp.prettier-vscode",
"llvm-vs-code-extensions.vscode-clangd",
"ms-python.python"
]
}
}
}
-55
View File
@@ -1,55 +0,0 @@
# Docker
<!--
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
-->
ubuntu:22.04
## Build and run image
### Build
Building the base image is required.
```
docker build -t carbon-ubuntu2404-base ./ubuntu2404/base
```
Build image using git repository
```bash
docker build -t carbon-ubuntu2404 ./ubuntu2404/github
```
Build image using copy instruction
```bash
docker build -f ./ubuntu2404/Dockerfile -t carbon-ubuntu2404 ..
```
Run image
```bash
docker run carbon-ubuntu2404
```
Run image using specific file
```bash
docker run carbon-ubuntu2404 bazel run //explorer -- ./explorer/testdata/print/format_only.carbon
```
### Using a mounted volume
Run from the repository root for PWD.
```
cd ..
```
```bash
docker run -w "/carbon-lang" -v "${PWD}:/carbon-lang" "carbon-ubuntu2404-base" bazel run "//explorer" -- "./explorer/testdata/print/format_only.carbon"
```
-15
View File
@@ -1,15 +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 carbon-ubuntu2404-base as carbon-ubuntu2404-build
COPY . /carbon-lang
WORKDIR /carbon-lang
# Build
RUN bazel build //explorer
FROM carbon-ubuntu2404-build
CMD ["bazel", "run", "//explorer", "--", "./explorer/testdata/print/format_only.carbon"]
-49
View File
@@ -1,49 +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:24.04 as carbon-ubuntu2404-base
# 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 \
software-properties-common \
wget \
nodejs \
npm
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 18 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-18/bin:${PATH}"
# Update pip and install black and pre-commit.
RUN pip3 install black pre-commit --break-system-packages
# Create .cache directory with proper ownership. We will mount a named volume
# at this location to allow caching of bazel build files.
RUN mkdir /home/ubuntu/.cache && chown -R ubuntu:ubuntu /home/ubuntu/.cache
-20
View File
@@ -1,20 +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 carbon-ubuntu2404-base as carbon-ubuntu2404-github-build
# Clone git repository
RUN git clone https://github.com/carbon-language/carbon-lang
WORKDIR /carbon-lang
# Setup pre-commit
RUN pre-commit install
# Build
RUN bazel build //explorer
FROM carbon-ubuntu2404-github-build
CMD ["bazel", "run", "//explorer", "--", "./explorer/testdata/print/format_only.carbon"]
-7
View File
@@ -227,13 +227,6 @@ considering if they fit your workflow.
**either** normal terminals **or** Visual Studio Code to run `bazel`,
not both in combination. Visual Studio Code can still be used for other
purposes, such as editing files, without interfering with `bazel`.
- [DevContainers](https://code.visualstudio.com/docs/remote/containers): A
way to use Docker for build environments.
- After following the
[installation instructions](https://code.visualstudio.com/docs/remote/containers#_installation),
you should be prompted to use Carbon's
[devcontainer](/.devcontainer/devcontainer.json) with "Reopen in
container".
- [clangd](https://clangd.llvm.org/installation): An LSP server implementation
for C/C++.
- To ensure that `clangd` reports accurate diagnostics. It needs a