Skip to content
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

Add support for Docker #222

Merged
merged 12 commits into from
Dec 30, 2024
Merged

Add support for Docker #222

merged 12 commits into from
Dec 30, 2024

Conversation

gaby
Copy link
Contributor

@gaby gaby commented Dec 28, 2024

  • Add Dockerfile to facilitate running repomix using Docker.
  • Update README with instructions on how to run the cli using Docker.
  • Add github-actions workflow for Building, and Publishing the image to Github Container Registry (ghcr.io).
    • Image will be build on each PR.
    • Image will only be published when a branch is merged into main, and when a release is tagged.
    • The image can be tested once a branch is merged by using the ghcr.io/yamadashy/repomix:main tag
    • The workflow will create semver tags for the Docker image.

Fixes #221

@yamadashy You may have to tweak Package Settings to make the image public. https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility

As a separate PR, we could make this repo a Github Action that people can run on their repos to automatically generate the output using repomix.

Copy link

stackblitz bot commented Dec 28, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

coderabbitai bot commented Dec 28, 2024

📝 Walkthrough

Walkthrough

This pull request introduces Docker support for Repomix by adding a new GitHub Actions workflow for building and publishing Docker images, creating a Dockerfile, and updating the README with Docker usage instructions. The workflow automates the process of building multi-platform Docker images for the project, enabling users to run Repomix in a containerized environment.

Changes

File Change Summary
.github/workflows/docker.yml New GitHub Actions workflow for automated Docker image building and publishing
Dockerfile Created Dockerfile using node:22-slim base image, installing necessary packages and setting up the container entry point
README.md Added Docker usage section with example command for running Repomix in a container
.dockerignore New file created to exclude unnecessary files from the Docker build context
CONTRIBUTING.md Added section for Docker usage with commands for building and running Repomix using Docker

Assessment against linked issues

Objective Addressed Explanation
Add support for Docker [#221]

Possibly related PRs


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
.github/workflows/docker.yml (2)

60-60: Enhance multi-platform support

Currently, the image is only built for linux/amd64. Consider adding support for ARM architectures to improve compatibility.

-          platforms: linux/amd64
+          platforms: linux/amd64,linux/arm64

7-8: Consider adding more specific path filters

The current path filters might miss important Docker-related changes. Consider adding more specific paths:

     paths-ignore:
       - "**.md"
       - LICENSE
+      - "docs/**"
+      - "*.txt"
     paths:
       - "Dockerfile"
+      - ".github/workflows/docker.yml"
+      - "docker/**"

Also applies to: 14-14

README.md (1)

98-104: Enhance Docker documentation

The current Docker documentation could be more comprehensive. Consider adding:

  1. Explanation of the volume mount (-v ./output:/app)
  2. Environment variables documentation
  3. More usage examples
  4. Troubleshooting section

Example additions:

### 🐳 Docker

Run Repomix using Docker:

```bash
# Basic usage
docker run -v ./output:/app -it --rm ghcr.io/yamadashy/repomix --remote https://github.com/yamadashy/repomix

# With custom configuration
docker run -v ./output:/app -v ./repomix.config.json:/app/repomix.config.json -it --rm ghcr.io/yamadashy/repomix

# Process local directory
docker run -v ./my-project:/app/src -v ./output:/app/output -it --rm ghcr.io/yamadashy/repomix ./src

Volume Mounts

  • -v ./output:/app: Mounts the local output directory to store the generated files
  • -v ./repomix.config.json:/app/repomix.config.json: (Optional) Mounts a custom configuration file

Environment Variables

  • REPOMIX_TOKEN: GitHub token for accessing private repositories
  • REPOMIX_CONFIG: Path to custom configuration file inside the container

Troubleshooting

  • Permission issues: If you encounter permission issues with the output directory, ensure it has the correct permissions: chmod 777 ./output
  • Network issues: When processing private repositories, ensure you've provided a valid GitHub token

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 28e3a76093093732022af039aeff7132b16dd4f3 and 05c73841e90f31306c0e8fc3b5e2a8485f9f3896.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `.github/workflows/docker.yml` (1 hunks)
* `Dockerfile` (1 hunks)
* `README.md` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 yamllint (1.35.1)</summary>

<details>
<summary>.github/workflows/docker.yml</summary>

[error] 1-1: wrong new line character: expected \n

(new-lines)

---

[error] 62-62: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Dockerfile Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
.github/workflows/docker.yml Outdated Show resolved Hide resolved
Copy link

@standard-input standard-input bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues flagged.
Standard Input can make mistakes. Check important info.

Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
Dockerfile (2)

3-6: Optimize apt-get commands for better caching

While the cleanup is good, we can further optimize the apt-get commands:

-RUN apt-get update && apt-get install -y --no-install-recommends \
+RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
     git \
     ca-certificates \
-    && rm -rf /var/lib/apt/lists/*
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*

18-18: Consider direct binary execution instead of npx

Using npx in a container adds unnecessary overhead since we're installing the package globally:

-ENTRYPOINT ["npx", "repomix"]
+ENTRYPOINT ["repomix"]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa4e7de and 22d0003.

📒 Files selected for processing (1)
  • Dockerfile (1 hunks)
🔇 Additional comments (2)
Dockerfile (2)

8-8: LGTM!

Setting the working directory to /app follows Docker best practices.


10-12: 🛠️ Refactor suggestion

Optimize npm installation for production use

Consider these improvements for better security and smaller image size:

 COPY package*.json ./
-RUN npm install
+RUN npm ci --only=production --no-audit \
+    && npm cache clean --force

This change:

  1. Uses npm ci for reproducible builds
  2. Installs only production dependencies
  3. Cleans npm cache to reduce image size

Likely invalid or redundant comment.

Dockerfile Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.01%. Comparing base (28e3a76) to head (b16f01f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #222   +/-   ##
=======================================
  Coverage   92.01%   92.01%           
=======================================
  Files          44       44           
  Lines        2041     2041           
  Branches      450      450           
=======================================
  Hits         1878     1878           
  Misses        163      163           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/workflows/docker.yml (1)

52-61: 🛠️ Refactor suggestion

Enhance build security and compliance

As mentioned in the previous review, consider adding security enhancements. Additionally:

      - name: Build and Publish Docker Image
        uses: docker/build-push-action@v6
        with:
          context: .
          push: ${{ github.event_name != 'pull_request' }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
-         platforms: linux/amd64
+         platforms: linux/amd64,linux/arm64
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
+         provenance: true
+         sbom: true
+         security-opt: seccomp=unconfined
+         no-cache: ${{ github.event_name == 'release' }}

Also add a vulnerability scanning step before pushing:

      - name: Run Trivy vulnerability scanner
        uses: aquasecurity/trivy-action@master
        if: github.event_name != 'pull_request'
        with:
          image-ref: ${{ steps.meta.outputs.tags }}
          format: 'sarif'
          output: 'trivy-results.sarif'
          severity: 'CRITICAL,HIGH'
          timeout: '10m'
🧹 Nitpick comments (5)
.github/workflows/docker.yml (5)

3-17: Enhance trigger paths for better coverage

Consider expanding the trigger paths to ensure all Docker-related changes are captured:

  push:
    branches:
      - "main"
    paths-ignore:
      - "**.md"
      - LICENSE
+      - ".gitignore"
  pull_request:
    branches:
      - "*"
    paths:
      - "Dockerfile"
+      - ".dockerignore"
+      - ".github/workflows/docker.yml"
+      - "docker-compose*.yml"

25-37: Add OCI image metadata labels

Consider adding standard OCI labels to improve image discoverability and documentation:

      - name: Docker metadata
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: |
            ghcr.io/yamadashy/repomix
+         labels: |
+           org.opencontainers.image.title=Repomix
+           org.opencontainers.image.description=A tool for mixing repository files
+           org.opencontainers.image.source={{repo}}
+           org.opencontainers.image.licenses=MIT
          tags: |
            type=ref,event=branch
            type=ref,event=pr
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}
            type=semver,pattern={{major}}.{{minor}}

38-43: Consider supporting additional platforms

The QEMU setup enables multi-platform builds, but the workflow only builds for linux/amd64. Consider adding support for ARM platforms:

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3
+        with:
+          platforms: linux/amd64,linux/arm64

44-51: Declare required token permissions

While the authentication setup is secure, it's recommended to explicitly declare the required token permissions:

Add this at the top of the workflow:

permissions:
  contents: read
  packages: write

1-61: Fix line endings

The file has incorrect line endings. Ensure consistent Unix-style line endings (\n) throughout the file.

Add a .gitattributes file to enforce consistent line endings:

+*.yml text eol=lf
+*.yaml text eol=lf
🧰 Tools
🪛 yamllint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b16f01f and 9ef44f1.

📒 Files selected for processing (1)
  • .github/workflows/docker.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/docker.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

🔇 Additional comments (1)
.github/workflows/docker.yml (1)

19-24: LGTM!

The job setup is well-configured with the latest Ubuntu runner and checkout action.

@gaby
Copy link
Contributor Author

gaby commented Dec 29, 2024

I can probably add a stage that runs the image in the workflow to make sure it's working before pushing it to ghcr.io

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
Dockerfile (1)

8-9: Consider using multi-stage build for better separation of concerns

While creating a dedicated directory is good, consider using a multi-stage build to separate build environment from runtime environment.

-RUN mkdir /repomix
-WORKDIR /repomix
+# Build stage
+FROM node:22-slim AS builder
+WORKDIR /build
 
+# Runtime stage
+FROM node:22-slim
+WORKDIR /app
.github/workflows/docker.yml (1)

27-39: Enhance Docker image metadata

Consider adding:

  1. The latest tag for the main branch
  2. Description and other OCI labels
         with:
           images: |
             ghcr.io/yamadashy/repomix
           tags: |
             type=ref,event=branch
             type=ref,event=pr
             type=semver,pattern={{version}}
             type=semver,pattern={{major}}
             type=semver,pattern={{major}}.{{minor}}
+            type=raw,value=latest,enable={{is_default_branch}}
+          labels: |
+            org.opencontainers.image.title=Repomix
+            org.opencontainers.image.description=CLI tool for repository management
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef44f1 and 632f560.

📒 Files selected for processing (2)
  • .github/workflows/docker.yml (1 hunks)
  • Dockerfile (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/docker.yml

[error] 1-1: wrong new line character: expected \n

(new-lines)

🔇 Additional comments (6)
Dockerfile (3)

1-6: LGTM! Base image setup follows best practices

The setup uses appropriate base image and follows Docker best practices:

  • Uses slim variant for smaller image size
  • Properly installs only required packages
  • Cleans up apt lists to reduce image size

21-23: LGTM! Runtime configuration is properly set

The working directory and entrypoint configuration are appropriate for running the CLI tool.


15-19: 🛠️ Refactor suggestion

Optimize build process and ensure proper file exclusions

  1. The build process could be optimized:
-RUN npm install \
-    && npm run build \
-    && npm link
+RUN npm run build && npm link
  1. Ensure you have a .dockerignore file to exclude unnecessary files (node_modules, .git, etc.) from the build context.
.github/workflows/docker.yml (3)

1-20: LGTM! Workflow triggers are well configured

The workflow triggers are comprehensive and include appropriate path filters to avoid unnecessary builds.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)


46-53: LGTM! Authentication is properly configured

The GitHub Container Registry authentication is correctly set up using the built-in GITHUB_TOKEN.


54-63: 🛠️ Refactor suggestion

Enhance build security and platform support

Consider these improvements:

  1. Enable security features
  2. Add multi-platform support
         with:
           context: .
           push: ${{ github.event_name != 'pull_request' }}
           cache-from: type=gha
           cache-to: type=gha,mode=max
-          platforms: linux/amd64
+          platforms: linux/amd64,linux/arm64
           tags: ${{ steps.meta.outputs.tags }}
           labels: ${{ steps.meta.outputs.labels }}
+          provenance: true
+          sbom: true

Likely invalid or redundant comment.

Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
CONTRIBUTING.md (1)

44-52: Enhance Docker usage documentation with more details and examples.

While the basic Docker commands are correct, the documentation could be more helpful for new users by:

  1. Explaining the volume mount:
Then, run the Docker container:
```bash
# Mount current directory to /app in container for processing local files
docker run -v ./:/app -it --rm repomix

2. Adding examples for specific commands:
```markdown
### Examples

Run with specific options:
```bash
docker run -v ./:/app -it --rm repomix --input ./input --output ./output

Run with environment variables:

docker run -v ./:/app -e NODE_ENV=production -it --rm repomix

Would you like me to provide a complete documentation update with these enhancements?

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 632f560c3dbbc3ecfd270b175791bf97cdac5122 and 99cc38e853fc5283e622009df04ed6b5aed6c5ed.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `CONTRIBUTING.md` (1 hunks)
* `README.md` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* README.md

</details>

<details>
<summary>🔇 Additional comments (1)</summary>

<details>
<summary>CONTRIBUTING.md (1)</summary>

`41-42`: **LGTM! Clear section introduction.**

The new Docker Usage section is well-placed and clearly introduced.

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Dockerfile (1)

8-9: Consider simplifying the directory structure.

The intermediate /repomix directory might be unnecessary since you later switch to /app. Consider consolidating the build process in a single directory.

-RUN mkdir /repomix
-WORKDIR /repomix
+WORKDIR /app
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99cc38e and fc73c4a.

📒 Files selected for processing (2)
  • Dockerfile (1 hunks)
  • README.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md
🔇 Additional comments (2)
Dockerfile (2)

1-6: LGTM! Base image and system dependencies are well configured.

The use of node:22-slim has been previously discussed and confirmed. The minimal system dependencies and cleanup of apt lists follow Docker best practices.


19-21: LGTM! Final configuration is appropriate for a CLI tool.

The working directory and entrypoint configuration are well-suited for running repomix as a CLI tool in a container.

Dockerfile Outdated Show resolved Hide resolved
@yamadashy
Copy link
Owner

Hi, @gaby !
Thank you so much for your implementation! I really appreciate your work on this, as I was hoping to make repomix runnable in Docker.

I've made a few adjustments, including tweaking the README and optimizing the image size.

I can probably add a stage that runs the image in the workflow to make sure it's working before pushing it to ghcr.io

That's a great idea! I'd really appreciate it if you could add a stage to the workflow to test the image before pushing it to ghcr.io. That would be a huge help in ensuring the quality of the image.

@gaby
Copy link
Contributor Author

gaby commented Dec 29, 2024

@yamadashy Instead of adding another stage. I'm running repomix --help at the end which confirms the cli is installed correctly.

See output here: https://github.com/gaby/repomix/actions/runs/12537229763/job/34961107768?pr=1

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/docker.yml (1)

40-45: Consider expanding platform support

QEMU is set up for multi-platform builds, but the build step only targets linux/amd64. Consider adding support for more platforms like linux/arm64 to improve compatibility.

-          platforms: linux/amd64
+          platforms: linux/amd64,linux/arm64

Also applies to: 61-61

CONTRIBUTING.md (1)

41-52: Enhance Docker usage documentation

The Docker usage instructions could be improved with:

  1. Clarification about the volume mount path
  2. Additional development-specific commands

Consider expanding the documentation:

 ### Docker Usage
 You can also run Repomix using Docker. Here's how:
 
 First, build the Docker image:
 ```bash
 docker build -t repomix .

Then, run the Docker container:

docker run -v ./:/app -it --rm repomix

+For development, you can run tests in Docker:
+bash +docker run -v ./:/app -it --rm repomix npm run test +
+
+Note: The -v ./:/app flag mounts your current directory to /app in the container,
+allowing you to edit files locally while running them in the container.


</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between d4052935ffea650cc99c6bd091da3e971b82f12b and 071bae06fb057194b38f6b3518ac3413134149ae.

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `.dockerignore` (1 hunks)
* `.github/workflows/docker.yml` (1 hunks)
* `CONTRIBUTING.md` (1 hunks)
* `Dockerfile` (1 hunks)
* `README.md` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (3)</summary>

* README.md
* Dockerfile
* .dockerignore

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 yamllint (1.35.1)</summary>

<details>
<summary>.github/workflows/docker.yml</summary>

[error] 1-1: wrong new line character: expected \n

(new-lines)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (3)</summary>

<details>
<summary>.github/workflows/docker.yml (3)</summary>

`3-20`: **LGTM! Well-structured workflow triggers.**

The workflow triggers are appropriately configured to:
- Build on main branch pushes while ignoring documentation changes
- Respond to PRs affecting Docker-related files
- Support manual triggering and release events

---

`27-39`: **Improve build security and compliance**

Consider adding security enhancements like provenance attestation and SBOM generation.

---

`46-53`: **LGTM! Secure registry authentication.**

The registry login is properly configured with:
- Conditional execution skipping PRs
- Secure token usage

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

.github/workflows/docker.yml Show resolved Hide resolved
@yamadashy
Copy link
Owner

@gaby
Thank you for your work!
I've separated the operation check part into a separate RUN command since it's okay to split the layers.

I'll proceed with merging this PR. If any additional adjustments are needed, I might reach out to you again, and I appreciate your help in advance.

Thanks again for your work on this!

@gaby
Copy link
Contributor Author

gaby commented Dec 30, 2024

@yamadashy Sounds good to me, once merge the docker push may fail depending on your settings for Packages, if it does check https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility and then replay the stage.

@yamadashy yamadashy merged commit fd7a179 into yamadashy:main Dec 30, 2024
1 check passed
@gaby
Copy link
Contributor Author

gaby commented Dec 30, 2024

@yamadashy Add this to the workflow between line 19-21:

permissions:
  contents: read
  packages: write

@yamadashy
Copy link
Owner

@gaby
Thank you! I've adjusted the repository settings, but it seems clearer and less risky to define the permissions in the workflow YAML files directly, so I'll go with that approach.

@gaby
Copy link
Contributor Author

gaby commented Dec 30, 2024

I see the image was posted!

https://github.com/yamadashy/repomix/pkgs/container/repomix

@gaby
Copy link
Contributor Author

gaby commented Dec 30, 2024

New workflow worked, image was also pushed.

@gaby gaby deleted the docker branch December 30, 2024 04:29
@yamadashy
Copy link
Owner

I'll try releasing a version now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Docker
2 participants