Skip to content
Merged
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
48 changes: 28 additions & 20 deletions .github/workflows/docker-build-push.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
# from https://docs.github.com/en/actions/guides/publishing-docker-images
# Based off https://docs.github.com/en/actions/guides/publishing-docker-images

name: Build and PushContainer
name: 🐳 Build and Push Container
on:
push:
branches:
- 'main'
- "main"
tags:
- '*'
pull_request:
- "*"
pull_request:
branches:
- 'main'
- "main"

env:
REGISTRY: ghcr.io
IMAGE_NAME: brown-bnc/xnat
IMAGE_NAME: ${{ github.repository }}

# Ensures PR builds with new commits are cancelled.
# Merge and release actions always complete
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build_and_push:
name: 🐳 Build and Push Container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: ⬇️ Checkout repo
uses: actions/checkout@v7

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the Container registry
uses: docker/login-action@v1
- name: 🔑 Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
- name: 🛠️ Setup Docker Buildx
uses: docker/setup-buildx-action@v4

- name: 🏗️ Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
- name: 🐳 Build and Push Docker Image
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64 # This must match the K8s environment's hardware
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# IDE
.vscode

# Env
.env
ldap.env
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# BUILD
# Build the XNAT web artifact from source
#-----------------------------------------------------------------------------
FROM eclipse-temurin:21-jdk as build
FROM eclipse-temurin:21-jdk AS build

# CAUTION: XNAT VERSION for this stage, make sure to also update next stage!!
ENV XNAT_VERSION=1.10.0
Expand Down Expand Up @@ -69,7 +69,7 @@ RUN cd /data/xnat/home/plugins \
&& curl -fLO "https://bitbucket.org/xnatx/pipeline_engine_plugin/downloads/pipeline_engine_ui-1.2.0-xpl.jar" \
&& curl -fLO "https://bitbucket.org/xnatdev/container-service/downloads/container-service-3.8.1-fat.jar" \
&& curl -fLO "https://github.com/NrgXnat/batch-transfer-plugin/releases/download/v1.1.1/batch-transfer-1.1.1.jar"

COPY docker-entrypoint.sh "/usr/local/bin/docker-entrypoint.sh"

# NOTE (BNR): Ports have the following use:
Expand Down