Skip to content

Commit 0c3f8a8

Browse files
committed
first pass at deno dockerfile. Update docker github workflow accordingly.
1 parent 25c4bb3 commit 0c3f8a8

File tree

2 files changed

+26
-56
lines changed

2 files changed

+26
-56
lines changed
Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build & publish containers
22

33
on:
4+
pull_request:
5+
branches: [master]
46
push:
57
tags:
68
- 'v[0-9]+.[0-9]+.[0-9]+'
@@ -9,6 +11,7 @@ jobs:
911
push_docker_to_registry:
1012
name: Push Docker image to Docker Hub
1113
runs-on: ubuntu-latest
14+
working-directory: bids-validator
1215
steps:
1316
- name: Check out the repo
1417
uses: actions/checkout@v4
@@ -29,61 +32,8 @@ jobs:
2932
uses: docker/build-push-action@v6
3033
with:
3134
context: .
32-
push: true
35+
push: false
36+
target: base
3337
tags: ${{ steps.meta.outputs.tags }}
3438
labels: ${{ steps.meta.outputs.labels }}
35-
36-
push_singularity_to_registry:
37-
runs-on: ubuntu-latest
38-
needs:
39-
- push_docker_to_registry
40-
steps:
41-
- name: Set up Go 1.13
42-
uses: actions/setup-go@v5
43-
with:
44-
go-version: 1.13
45-
id: go
46-
- name: Install Dependencies
47-
run: |
48-
sudo apt-get update && sudo apt-get install -y \
49-
build-essential \
50-
libssl-dev \
51-
uuid-dev \
52-
libgpgme11-dev \
53-
squashfs-tools \
54-
libseccomp-dev \
55-
pkg-config
56-
- name: Install Singularity
57-
env:
58-
SINGULARITY_VERSION: 3.8.0
59-
GOPATH: /tmp/go
60-
run: |
61-
mkdir -p $GOPATH
62-
sudo mkdir -p /usr/local/var/singularity/mnt && \
63-
mkdir -p $GOPATH/src/github.com/sylabs && \
64-
cd $GOPATH/src/github.com/sylabs && \
65-
wget -qO- https://github.com/sylabs/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-ce-${SINGULARITY_VERSION}.tar.gz | \
66-
tar xzv && \
67-
cd singularity-ce-${SINGULARITY_VERSION} && \
68-
./mconfig -p /usr/local && \
69-
make -C builddir && \
70-
sudo make -C builddir install
71-
- name: Check out code for the container build
72-
uses: actions/checkout@v4
73-
- name: Extract metadata (tags, labels) for Docker
74-
id: meta
75-
uses: docker/metadata-action@v5
76-
with:
77-
images: bids/validator
78-
- name: Build Container
79-
run: |
80-
tags=${{ steps.meta.outputs.tags }}
81-
echo $tags
82-
singularity pull container.sif docker://${tags%,*}
83-
- name: Login and Deploy Container
84-
if: (github.event_name != 'pull_request')
85-
run: |
86-
tags=${{ steps.meta.outputs.tags }}
87-
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
88-
for tag in $(echo $tags | sed "s/,/ /g" | sed "s/bids\/validator/bids-standard\/bids-validator/g");
89-
do echo $tag; singularity push container.sif oras://ghcr.io/$tag; done
39+
outputs: type=cacheonly

bids-validator/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ARG BASE_IMAGE=denoland/deno:2.0.1
2+
FROM ${BASE_IMAGE} AS base
3+
WORKDIR /src
4+
5+
RUN apt-get update && \
6+
apt-get install -y git && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/*
9+
10+
COPY . .
11+
RUN deno cache ./bids-validator-deno
12+
RUN ./build.ts
13+
14+
ENTRYPOINT ["./bids-validator-deno"]
15+
16+
FROM ${BASE_IMAGE} AS min
17+
WORKDIR /src
18+
COPY --from=base /src/dist/validator/* .
19+
20+
ENTRYPOINT ["deno", "-A", "./bids-validator.js"]

0 commit comments

Comments
 (0)