Skip to content

Commit

Permalink
add initial Dockerfile
Browse files Browse the repository at this point in the history
cleanup apk after install

update for security notes

add no-cache to apk
  • Loading branch information
goatshriek committed Oct 29, 2024
1 parent a715933 commit 5c90baa
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ jobs:
run: bundle exec rake test:python
- name: Run Python Examples
run: bundle exec rake examples:python
docker:
runs-on: ubuntu-latest
name: docker build
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
file: 'tools/docker/Dockerfile'
push: false
tags: 'wrapture'
sonar-analysis:
runs-on: ubuntu-latest
name: SonarCloud analysis
Expand Down
7 changes: 7 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Development Tools
This directory has configuration and support files for external tools that are
used in Wrapture development.


## docker
Contains the Dockerfile used to build the wrapture container image.
22 changes: 22 additions & 0 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ruby:3.3.5-alpine3.20

# copy the build-necessary source into the container
WORKDIR /usr/src/wrapture
COPY bin ./bin
COPY lib ./lib
COPY sig ./sig
COPY Gemfile wrapture.gemspec ./

# set up the environment for the build
RUN apk update \
&& apk add --no-cache --virtual build-dependencies build-base \
&& bundle install \
&& gem build --output wrapture.gem wrapture.gemspec \
&& gem install wrapture.gem \
&& apk del build-dependencies \
&& addgroup -S wrapture \
&& adduser -S wrapture -G wrapture

# set the user to wrapture
WORKDIR /home/wrapture
USER wrapture

0 comments on commit 5c90baa

Please sign in to comment.