Skip to content

Commit

Permalink
Merge pull request #16 from runwaylab/docker-cleanup
Browse files Browse the repository at this point in the history
Docker Cleanup / Improvements
  • Loading branch information
GrantBirki authored May 8, 2024
2 parents 1cab254 + 46d7fb4 commit bee6b33
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ docs/
.cache/
.github/
bin/
assets/
coverage/
data/
LICENSE
Makefile
README.md
CONTRIBUTING.md
SECURITY.md
docker-compose.yml
docker-compose.override.yml
docker-compose.production.yml
tmp/
.ameba.yml
12 changes: 6 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: extract image metadata
id: meta
uses: docker/[email protected]
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -43,28 +43,28 @@ jobs:
type=sha
- name: set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # pin@v3

- name: set up docker buildx
uses: docker/[email protected]
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # pin@v3.3.0

- name: login to ghcr
if: github.event_name != 'pull_request'
uses: docker/[email protected]
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # pin@v3.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build and push
id: push
uses: docker/[email protected]
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # pin@v5.3.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
# platforms: linux/amd64,linux/arm64

# - name: generate artifact attestation
# uses: actions/[email protected]
Expand Down
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
FROM crystallang/crystal:1.12.1 as builder

LABEL org.opencontainers.image.title="runway"
LABEL org.opencontainers.image.description="clearing code for take off"
LABEL org.opencontainers.image.source="https://github.com/runwaylab/runway"
LABEL org.opencontainers.image.documentation="https://github.com/runwaylab/runway"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="Grant Birkinbine"

WORKDIR /app

# install build dependencies
Expand All @@ -19,7 +26,7 @@ COPY shard.lock shard.lock
COPY shard.yml shard.yml

# bootstrap the project
RUN script/bootstrap
RUN USE_LINUX_VENDOR=true script/bootstrap

# copy all source files (ensure to use a .dockerignore file for efficient copying)
COPY . .
Expand All @@ -32,9 +39,6 @@ FROM crystallang/crystal:1.12.1
# install runtime dependencies
RUN apt-get update && apt-get install libssh2-1-dev -y

# add curl for healthchecks
# RUN apt-get update && apt-get install -y curl

# create a non-root user for security
RUN useradd -m nonroot
USER nonroot
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<a href="https://github.com/runwayapp/runway/actions/workflows/lint.yml"><img src="https://github.com/runwayapp/runway/actions/workflows/lint.yml/badge.svg?event=push" alt="lint"/></a>
<a href="https://github.com/runwayapp/runway/actions/workflows/acceptance.yml"><img src="https://github.com/runwayapp/runway/actions/workflows/acceptance.yml/badge.svg?event=push" alt="acceptance"/></a>
<a href="https://github.com/runwayapp/runway/actions/workflows/build.yml"><img src="https://github.com/runwayapp/runway/actions/workflows/build.yml/badge.svg?event=push" alt="build"/></a>
<a href="https://github.com/runwaylab/runway/actions/workflows/docker.yml/badge.svg"><img src="https://github.com/runwaylab/runway/actions/workflows/docker.yml/badge.svg?event=push" alt="build"/></a>
</p>

<p align="center">
Expand Down

0 comments on commit bee6b33

Please sign in to comment.