Skip to content

Upload using docker #26

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,29 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- "3.1"
name: Ruby in Docker

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker build -t ruby-test -f Dockerfile .

- name: Run tests in Docker
run: |
docker run --rm \
-v "$(pwd)":/app \
-w /app \
ruby-test \
bundle exec rspec --require spec_helper

- name: Run the default task
run: bundle exec rspec --require spec_helper
- name: Check coverage file exists
run: test -f coverage/coverage.json

- uses: qltysh/qlty-action/coverage@v1
with:
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ruby:3.3

WORKDIR /app

COPY . .

Comment on lines +1 to +6
Copy link

Choose a reason for hiding this comment

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

Found 4 issues:

1. Ensure that HEALTHCHECK instructions have been added to container images [checkov:CKV_DOCKER_2]


2. Ensure that a user for the container has been created [checkov:CKV_DOCKER_3]


3. Specify at least 1 USER command in Dockerfile with non-root user as argument [trivy:DS002]


4. Add HEALTHCHECK instruction in your Dockerfile [trivy:DS026]

RUN gem install bundler && bundle install