Rework dockerfile with a better shell, user config, and static analysis
This commit is contained in:
6
.clang-tidy
Normal file
6
.clang-tidy
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
Checks: "bugprone-*, clang-analyzer-*, clang-diagnostic-*, concurrency-*, cppcoreguidelines-*, google-*, misc-*, modernize-*, performance-*, portability-*, -modernize-use-trailing-return-type"
|
||||||
|
WarningsAsErrors: true
|
||||||
|
HeaderFilterRegex: ""
|
||||||
|
AnalyzeTemporaryDtors: false
|
||||||
|
FormatStyle: none
|
||||||
44
Dockerfile
44
Dockerfile
@ -1,15 +1,39 @@
|
|||||||
FROM gcc:12
|
FROM gcc:13
|
||||||
|
|
||||||
# Install build tools
|
# Install build tools
|
||||||
RUN apt-get update && apt-get install -y python3 python3-pip ninja-build gdb graphviz
|
RUN apt-get update && apt-get install -y python3 python3-pip ninja-build clang-format clang-tidy gdb graphviz git curl zsh \
|
||||||
RUN pip install meson gcovr
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# The version of doxy in the Debian repos is too old to support concepts, so we grab the latest release and manually install
|
|
||||||
RUN wget --progress=bar:force:noscroll https://www.doxygen.nl/files/doxygen-1.9.5.linux.bin.tar.gz && \
|
RUN pip install --break-system-packages meson gcovr
|
||||||
tar -xzf doxygen-1.9.5.linux.bin.tar.gz && \
|
|
||||||
cd doxygen-1.9.5 && \
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/bin
|
||||||
|
|
||||||
|
# Install latest doxygen
|
||||||
|
RUN wget --progress=bar:force:noscroll https://www.doxygen.nl/files/doxygen-1.10.0.linux.bin.tar.gz && \
|
||||||
|
tar -xzf doxygen-1.10.0.linux.bin.tar.gz && \
|
||||||
|
cd doxygen-1.10.0 && \
|
||||||
make install && \
|
make install && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
rm -r doxygen-1.9.5.linux.bin.tar.gz && \
|
rm -r doxygen-1.10.0.linux.bin.tar.gz && \
|
||||||
rm -r doxygen-1.9.5
|
rm -r doxygen-1.10.0
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
# Add a user `dev` with UID/GID 1000
|
||||||
|
# Set zsh as the default shell for this user
|
||||||
|
RUN groupadd -g 1000 dev && \
|
||||||
|
useradd -m -u 1000 -g dev -s /bin/zsh dev
|
||||||
|
|
||||||
|
# Change to non-root user
|
||||||
|
USER dev
|
||||||
|
|
||||||
|
# Set up zsh to not suck
|
||||||
|
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
|
||||||
|
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.5/zsh-in-docker.sh)" -- \
|
||||||
|
-t robbyrussell \
|
||||||
|
-p https://github.com/zsh-users/zsh-autosuggestions \
|
||||||
|
-p https://github.com/zsh-users/zsh-syntax-highlighting \
|
||||||
|
-a 'bindkey "^[l" autosuggest-accept'
|
||||||
|
|
||||||
|
# Set the default shell for the container (optional, since it's already the default for the user)
|
||||||
|
# This is more about setting the shell when you exec into the container rather than changing the user's shell
|
||||||
|
SHELL ["/bin/zsh", "-c"]
|
||||||
|
ENTRYPOINT ["/bin/zsh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user