-
Notifications
You must be signed in to change notification settings - Fork 175
feat: dev container #982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: dev container #982
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,59 @@ | ||
| # IvorySQL Build and Test Container - Modern Ubuntu | ||
| # Alternative to CentOS with same capabilities | ||
|
|
||
| FROM ubuntu:22.04 | ||
|
|
||
| # Prevent interactive prompts | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Install build dependencies matching the workflow requirements | ||
| RUN apt-get update && apt-get install -y \ | ||
| # Build tools | ||
| build-essential git lcov bison flex pkg-config cppcheck \ | ||
| # Core dependencies | ||
| libkrb5-dev libssl-dev libldap-dev libpam-dev \ | ||
| libxml2-dev libxslt-dev libreadline-dev libedit-dev \ | ||
| zlib1g-dev uuid-dev libossp-uuid-dev libuuid1 e2fsprogs \ | ||
| # ICU support | ||
| libicu-dev \ | ||
| # Language support | ||
| python3-dev tcl-dev libperl-dev gettext \ | ||
| # Perl test modules | ||
| libipc-run-perl libtime-hires-perl libtest-simple-perl \ | ||
| # LLVM/Clang | ||
| llvm clang \ | ||
| # LZ4 compression | ||
| liblz4-dev \ | ||
| # System libraries | ||
| libselinux1-dev libsystemd-dev \ | ||
| # GSSAPI | ||
| libgssapi-krb5-2 \ | ||
| # Locale support | ||
| locales \ | ||
| # For dev containers | ||
| sudo tini \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Set up locale | ||
| RUN locale-gen en_US.UTF-8 | ||
| ENV LANG=en_US.UTF-8 \ | ||
| LANGUAGE=en_US:en \ | ||
| LC_ALL=en_US.UTF-8 | ||
|
|
||
| # Create ivorysql user with matching host UID/GID (1000:1000) | ||
| # and grant sudo privileges without password | ||
| ARG USER_UID=1000 | ||
| ARG USER_GID=1000 | ||
| RUN groupadd -g ${USER_GID} ivorysql || true && \ | ||
| useradd -m -u ${USER_UID} -g ${USER_GID} -d /home/ivorysql -s /bin/bash ivorysql && \ | ||
| echo "ivorysql ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
|
||
| # Set working directory | ||
| WORKDIR /home/ivorysql/IvorySQL | ||
|
|
||
| # Switch to ivorysql user for builds | ||
| USER ivorysql | ||
|
|
||
| # Default command | ||
| ENTRYPOINT ["/usr/bin/tini", "--"] | ||
| CMD ["/bin/bash"] | ||
This file contains hidden or 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,22 @@ | ||
| { | ||
| "name": "IvorySQL Dev", | ||
| "dockerComposeFile": "../docker-compose.yaml", | ||
| "service": "dev", | ||
| "workspaceFolder": "/home/ivorysql/IvorySQL", | ||
| "remoteUser": "ivorysql", | ||
| "customizations": { | ||
| "vscode": { | ||
| "settings": { | ||
| "terminal.integrated.defaultProfile.linux": "bash", | ||
| "C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools" | ||
| }, | ||
| "extensions": [ | ||
| "ms-vscode.cpptools", | ||
| "ms-vscode.makefile-tools", | ||
| "twxs.cmake", | ||
| "mhutchie.git-graph", | ||
| "eamodio.gitlens" | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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,18 @@ | ||
| services: | ||
| dev: | ||
| build: | ||
| context: . | ||
| dockerfile: .devcontainer/Dockerfile | ||
| image: ivorysql-dev | ||
| container_name: ivorysql-dev | ||
| volumes: | ||
| - .:/home/ivorysql/IvorySQL:rw | ||
| working_dir: /home/ivorysql/IvorySQL | ||
| command: ["sleep", "infinity"] | ||
|
|
||
| # docker compose --profile ora up -d | ||
| oracle: | ||
| profiles: [ora] | ||
| image: container-registry.oracle.com/database/free:23.26.0.0-lite | ||
| environment: | ||
| ORACLE_PWD: orapwd |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security risk: passwordless sudo for all commands.
Granting the
ivorysqluser passwordless sudo access to all commands poses a security risk. Even in development containers, this should be restricted or at minimum documented with clear security disclaimers. Consider limiting sudo to specific commands (e.g.,apt-get, package management) or requiring authentication for sensitive operations.If passwordless sudo is intentional, add a comment explaining the security trade-off and the intended use case (e.g., "local dev-only, not for production").
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Dockerfile is located at
.devcontainer/Dockerfile, which should be obvious this is dev-only.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rophy, you're absolutely right—the
.devcontainer/directory is a well-established convention that clearly signals this is a development-only container. I appreciate you clarifying that context. I'll note your preference here and won't flag similar patterns in dev container configurations.🐰✨