-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile ubuntu ready, compose too. commiting trunk as well
- Loading branch information
Showing
11 changed files
with
281 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*out | ||
*logs | ||
*actions | ||
*notifications | ||
*tools | ||
plugins | ||
user_trunk.yaml | ||
user.yaml | ||
tmp |
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,4 @@ | ||
# Following source doesn't work in most setups | ||
ignored: | ||
- SC1090 | ||
- SC1091 |
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,10 @@ | ||
# Autoformatter friendly markdownlint config (all formatting rules disabled) | ||
default: true | ||
blank_lines: false | ||
bullet: false | ||
html: false | ||
indentation: false | ||
line_length: false | ||
spaces: false | ||
url: false | ||
whitespace: false |
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,7 @@ | ||
rules: | ||
quoted-strings: | ||
required: only-when-needed | ||
extra-allowed: ["{|}"] | ||
key-duplicates: {} | ||
octal-values: | ||
forbid-implicit-octal: true |
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,34 @@ | ||
# This file controls the behavior of Trunk: https://docs.trunk.io/cli | ||
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml | ||
version: 0.1 | ||
cli: | ||
version: 1.20.1 | ||
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) | ||
plugins: | ||
sources: | ||
- id: trunk | ||
ref: v1.4.3 | ||
uri: https://github.com/trunk-io/plugins | ||
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) | ||
runtimes: | ||
enabled: | ||
- node@18.12.1 | ||
- python@3.10.8 | ||
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) | ||
lint: | ||
enabled: | ||
- checkov@3.2.24 | ||
- git-diff-check | ||
- hadolint@2.12.0 | ||
- markdownlint@0.39.0 | ||
- prettier@3.2.5 | ||
- terrascan@1.18.11 | ||
- trivy@0.49.1 | ||
- trufflehog@3.68.0 | ||
- yamllint@1.35.1 | ||
actions: | ||
enabled: | ||
- trunk-announce | ||
- trunk-check-pre-push | ||
- trunk-fmt-pre-commit | ||
- trunk-upgrade-available |
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,91 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Comments are provided throughout this file to help you get started. | ||
# If you need more help, visit the Dockerfile reference guide at | ||
# https://docs.docker.com/go/dockerfile-reference/ | ||
|
||
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7 | ||
|
||
################################################################################ | ||
# Pick a base image to serve as the foundation for the other build stages in | ||
# this file. | ||
# | ||
# For illustrative purposes, the following FROM command | ||
# is using the alpine image (see https://hub.docker.com/_/alpine). | ||
# By specifying the "latest" tag, it will also use whatever happens to be the | ||
# most recent version of that image when you build your Dockerfile. | ||
# If reproducability is important, consider using a versioned tag | ||
# (e.g., alpine:3.17.2) or SHA (e.g., alpine@sha256:c41ab5c992deb4fe7e5da09f67a8804a46bd0592bfdf0b1847dde0e0889d2bff). | ||
FROM alpine:3.19.1 as base | ||
|
||
RUN apk --no-cache add \ | ||
coreutils \ | ||
gcc \ | ||
gcovr \ | ||
valgrind \ | ||
libc-dev \ | ||
gdb | ||
|
||
RUN gem install ceedling | ||
|
||
################################################################################ | ||
# Create a stage for building/compiling the application. | ||
# | ||
# The following commands will leverage the "base" stage above to generate | ||
# a "hello world" script and make it executable, but for a real application, you | ||
# would issue a RUN command for your application's build process to generate the | ||
# executable. For language-specific examples, take a look at the Dockerfiles in | ||
# the Awesome Compose repository: https://github.com/docker/awesome-compose | ||
FROM base as build | ||
|
||
# Install all necessary build tools and dependencies. | ||
RUN apk update | ||
RUN apk --update-cache add \ | ||
bash \ | ||
vim \ | ||
wget | ||
|
||
# Manually install ruby 3.1.4 to avoid issues with the ceedling version 0.31.1 'exist' issue which is deprecated in the latest version of ruby (>3.2) | ||
RUN wget https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.4.tar.gz | ||
RUN tar -xzvf ruby-3.1.4.tar.gz | ||
RUN cd ruby-3.1.4 && ./configure && make && make Install | ||
|
||
# Install ceedling | ||
RUN gen update && \ | ||
gem install ceedling | ||
|
||
|
||
RUN echo -e '#!/bin/sh\n\ | ||
echo Hello world from $(whoami)! In order to get your application running in a container, take a look at the comments in the Dockerfile to get started.'\ | ||
> /bin/hello.sh | ||
RUN chmod +x /bin/hello.sh | ||
|
||
################################################################################ | ||
# Create a final stage for running your application. | ||
# | ||
# The following commands copy the output from the "build" stage above and tell | ||
# the container runtime to execute it when the image is run. Ideally this stage | ||
# contains the minimal runtime dependencies for the application as to produce | ||
# the smallest image possible. This often means using a different and smaller | ||
# image than the one used for building the application, but for illustrative | ||
# purposes the "base" image is used here. | ||
FROM base AS final | ||
|
||
# Create a non-privileged user that the app will run under. | ||
# See https://docs.docker.com/go/dockerfile-user-best-practices/ | ||
ARG UID=10001 | ||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/nonexistent" \ | ||
--shell "/sbin/nologin" \ | ||
--no-create-home \ | ||
--uid "${UID}" \ | ||
appuser | ||
USER appuser | ||
|
||
# Copy the executable from the "build" stage. | ||
COPY --from=build /bin/hello.sh /bin/ | ||
|
||
# What the container should run when it is started. | ||
ENTRYPOINT [ "/bin/hello.sh" ] |
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,47 @@ | ||
FROM alpine:3.19.1 as final | ||
MAINTAINER lior.dux@develeap.com | ||
|
||
# Install all necessary build tools and dependencies. | ||
RUN apk --update-cache add \ | ||
openssl \ | ||
openssl-dev \ | ||
perl \ | ||
make \ | ||
gcc \ | ||
gcompat \ | ||
|
||
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub &&\ | ||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk &&\ | ||
apk add glibc-2.35-r1.apk | ||
|
||
coreutils \ | ||
gcovr \ | ||
valgrind \ | ||
libc-dev \ | ||
gdb \ | ||
|
||
# Additions to the base image | ||
RUN apk --update-cache add \ | ||
bash \ | ||
git \ | ||
wget \ | ||
curl \ | ||
vim \ | ||
|
||
|
||
#&& rm -rf /var/cache/apk/* | ||
|
||
# Install rbenv-build | ||
RUN wget -q https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer -O- | bash | ||
RUN echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bash_profile | ||
|
||
# rbenv | ||
ENV RBENV_ROOT /root/.rbenv/bin/rbenv | ||
ENV RUBY_VERSION 3.0.6 | ||
#ENV CONFIGURE_OPTS --disable-install-doc | ||
|
||
|
||
RUN rbenv install $RUBY_VERSION &&\ | ||
rbenv global $RUBY_VERSION | ||
|
||
RUN gem install bundler |
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,17 @@ | ||
### Building and running your application | ||
|
||
When you're ready, start your application by running: | ||
`docker compose up --build`. | ||
|
||
### Deploying your application to the cloud | ||
|
||
First, build your image, e.g.: `docker build -t myapp .`. | ||
If your cloud uses a different CPU architecture than your development | ||
machine (e.g., you are on a Mac M1 and your cloud provider is amd64), | ||
you'll want to build the image for that platform, e.g.: | ||
`docker build --platform=linux/amd64 -t myapp .`. | ||
|
||
Then, push it to your registry, e.g. `docker push myregistry.com/myapp`. | ||
|
||
Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/) | ||
docs for more detail on building and pushing. |
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,28 @@ | ||
# Comments are provided throughout this file to help you get started. | ||
# If you need more help, visit the Docker compose reference guide at | ||
# https://docs.docker.com/go/compose-spec-reference/ | ||
|
||
# Here the instructions define your application as a service called "app". | ||
# This service is built from the Dockerfile in the current directory. | ||
# You can add other services your application may depend on here, such as a | ||
# database or a cache. For examples, see the Awesome Compose repository: | ||
# https://github.com/docker/awesome-compose | ||
services: | ||
app: | ||
image: druxx/ubuntu-ceedling:22.04-v0.31.1 | ||
platform: linux/amd64 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.ubuntu | ||
tty: true | ||
stdin_open: true | ||
command: /bin/bash | ||
volumes: | ||
- ./demo:/project | ||
restart: unless-stopped | ||
|
||
# If your application exposes a port, uncomment the following lines and change | ||
# the port numbers as needed. The first number is the host port and the second | ||
# is the port inside the container. | ||
# ports: | ||
# - 8080:8080 |
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