-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat docker: add ubuntu-22.04-pg-dev image
commit_hash:01f828bc761543e62cc2238d604a16ad5c05695e
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Exit on any error and treat unset variables as errors, print all commands | ||
set -euox pipefail | ||
|
||
# Install a proper compilation toolchain | ||
apt update | ||
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ | ||
clang-18 \ | ||
lld-18 \ | ||
llvm-18 \ | ||
clangd-18 \ | ||
clang-format-18 \ | ||
clang-tidy-18 \ | ||
libclang-rt-18-dev | ||
apt clean all | ||
|
||
# Prefer clang-18 toolchain by default | ||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 | ||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 | ||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 | ||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 | ||
update-alternatives --install /usr/bin/lld lld /usr/bin/lld-18 100 | ||
update-alternatives --install /usr/bin/ld ld /usr/bin/lld 100 | ||
update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-18 100 | ||
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 100 | ||
update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 100 | ||
|
||
# Create user "user" for non-root access to services in devcontainer | ||
USERNAME=user | ||
USER_UID=1000 | ||
USER_GID=$USER_UID | ||
groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM ghcr.io/userver-framework/ubuntu-22.04-userver-pg:latest | ||
|
||
COPY scripts/docker/setup-dev.sh /userver_tmp/ | ||
RUN /userver_tmp/setup-dev.sh && rm -rf /userver_tmp | ||
|
||
EXPOSE 8080-8100 |