Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit a5e6e8f

Browse files
committed
Update ubuntu default docker variant to jammy (22.04 LTS). Pump gcc default version to 12. Pump LLVM default version to 15. Update Readme
1 parent 5b8635d commit a5e6e8f

File tree

3 files changed

+23
-27
lines changed

3 files changed

+23
-27
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# [Choice] bionic (18.04), focal (20.04)
2-
ARG VARIANT="focal"
1+
# [Choice] bionic (18.04), focal (20.04), jammy (22.04)
2+
ARG VARIANT="jammy"
33
FROM ubuntu:${VARIANT}
44

55
# Restate the variant to use it later on in the llvm and cmake installations
@@ -28,9 +28,9 @@ ENV CONAN_SYSREQUIRES_SUDO 0
2828
ENV CONAN_SYSREQUIRES_MODE enabled
2929

3030
# User-settable versions:
31-
# This Dockerfile should support gcc-[7, 8, 9, 10, 11] and clang-[10, 11, 12, 13]
31+
# This Dockerfile should support gcc-[7, 8, 9, 10, 11, 12] and clang-[10, 11, 12, 13, 14, 15]
3232
# Earlier versions of clang will require significant modifications to the IWYU section
33-
ARG GCC_VER="11"
33+
ARG GCC_VER="12"
3434
# Add gcc-${GCC_VER}
3535
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
3636
apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \
@@ -41,7 +41,7 @@ RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
4141
RUN update-alternatives --install /usr/bin/gcc gcc $(which gcc-${GCC_VER}) 100
4242
RUN update-alternatives --install /usr/bin/g++ g++ $(which g++-${GCC_VER}) 100
4343

44-
ARG LLVM_VER="13"
44+
ARG LLVM_VER="15"
4545
# Add clang-${LLVM_VER}
4646
ARG LLVM_URL="http://apt.llvm.org/${VARIANT}/"
4747
ARG LLVM_PKG="llvm-toolchain-${VARIANT}-${LLVM_VER}"
@@ -113,8 +113,4 @@ ENV CXX=${USE_CLANG:+"clang++"}
113113
ENV CC=${CC:-"gcc"}
114114
ENV CXX=${CXX:-"g++"}
115115

116-
# Include project
117-
#ADD . /workspaces/cpp_starter_project
118-
#WORKDIR /workspaces/cpp_starter_project
119-
120116
CMD ["/bin/bash"]

.devcontainer/devcontainer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"name": "C++",
55
"build": {
66
"dockerfile": "Dockerfile",
7-
// Update 'VARIANT' to pick an Ubuntu OS version. Options: [bionic, focal]. Default: focal
8-
// Update 'GCC_VER' to pick a gcc and g++ version. Options: [7, 8, 9, 10, 11]. Default: 11
9-
// Update 'LLVM_VER' to pick clang version. Options: [10, 11, 12, 13]. Default: 13
7+
// Update 'VARIANT' to pick an Ubuntu OS version. Options: [bionic, focal, jammy]. Default: jammy
8+
// Update 'GCC_VER' to pick a gcc and g++ version. Options: [7, 8, 9, 10, 11, 12]. Default: 12
9+
// Update 'LLVM_VER' to pick clang version. Options: [10, 11, 12, 13, 14, 15]. Default: 15
1010
// Update 'USE_CLANG' to set clang as the default C and C++ compiler. Options: [1, null]. Default null
1111
// "args": {
12-
// "VARIANT": "focal",
13-
// "GCC_VER": "11",
14-
// "LLVM_VER": "13"
12+
// "VARIANT": "jammy",
13+
// "GCC_VER": "12",
14+
// "LLVM_VER": "15"
1515
// }
1616
},
1717
"runArgs": [

README_docker.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ docker build -f ./.devcontainer/Dockerfile --tag=my_project:latest .
88
docker run -it my_project:latest
99
```
1010

11-
This command will put you in a `bash` session in a Ubuntu 20.04 Docker container,
11+
This command will put you in a `bash` session in a Ubuntu 22.04 Docker container,
1212
with all of the tools listed in the [Dependencies](#dependencies) section already installed.
13-
Additionally, you will have `g++-11` and `clang++-13` installed as the default
13+
Additionally, you will have `g++-12` and `clang++-15` installed as the default
1414
versions of `g++` and `clang++`.
1515

1616
If you want to build this container using some other versions of gcc and clang,
1717
you may do so with the `GCC_VER` and `LLVM_VER` arguments:
1818

1919
```bash
20-
docker build --tag=myproject:latest --build-arg GCC_VER=10 --build-arg LLVM_VER=11 .
20+
docker build --tag=myproject:latest --build-arg GCC_VER=11 --build-arg LLVM_VER=14 .
2121
```
2222

23-
The CC and CXX environment variables are set to GCC version 11 by default.
23+
The CC and CXX environment variables are set to GCC by default.
2424
If you wish to use clang as your default CC and CXX environment variables, you
2525
may do so like this:
2626

@@ -29,7 +29,7 @@ docker build --tag=my_project:latest --build-arg USE_CLANG=1 .
2929
```
3030

3131
You will be logged in as root, so you will see the `#` symbol as your prompt.
32-
You will be in a directory that contains a copy of the `cpp_starter_project`;
32+
You will be in a directory that contains a copy of the `cmake_conan_boilerplate_template`;
3333
any changes you make to your local copy will not be updated in the Docker image
3434
until you rebuild it.
3535
If you need to mount your local copy directly in the Docker image, see
@@ -45,18 +45,18 @@ docker run -it \
4545
You can configure and build [as directed above](#build) using these commands:
4646

4747
```bash
48-
/starter_project# mkdir build
49-
/starter_project# cmake -S . -B ./build
50-
/starter_project# cmake --build ./build
48+
/cmake_conan_boilerplate_template# mkdir build
49+
/cmake_conan_boilerplate_template# cmake -S . -B ./build
50+
/cmake_conan_boilerplate_template# cmake --build ./build
5151
```
5252

53-
You can configure and build using `clang-13`, without rebuilding the container,
53+
You can configure and build using `clang`, without rebuilding the container,
5454
with these commands:
5555

5656
```bash
57-
/starter_project# mkdir build
58-
/starter_project# CC=clang CXX=clang++ cmake -S . -B ./build
59-
/starter_project# cmake --build ./build
57+
/cmake_conan_boilerplate_template# mkdir build
58+
/cmake_conan_boilerplate_template# CC=clang CXX=clang++ cmake -S . -B ./build
59+
/cmake_conan_boilerplate_template# cmake --build ./build
6060
```
6161

6262
The `ccmake` tool is also installed; you can substitute `ccmake` for `cmake` to

0 commit comments

Comments
 (0)