Skip to content

Commit 5a71902

Browse files
authored
Merge pull request #3754 from tdonohue/update_docker_to_ghcr
[GitHub Actions][Docker] Update Docker scripts & GitHub Actions to use ghcr.io instead of docker.io
2 parents ac00f88 + dab6b1c commit 5a71902

File tree

10 files changed

+29
-16
lines changed

10 files changed

+29
-16
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ name: Build
77
on: [push, pull_request]
88

99
permissions:
10-
contents: read # to fetch code (actions/checkout)
10+
contents: read # to fetch code (actions/checkout)
11+
packages: read # to fetch private images from GitHub Container Registry (GHCR)
1112

1213
jobs:
1314
tests:
@@ -35,6 +36,9 @@ jobs:
3536
NODE_OPTIONS: '--max-old-space-size=4096'
3637
# Project name to use when running "docker compose" prior to e2e tests
3738
COMPOSE_PROJECT_NAME: 'ci'
39+
# Docker Registry to use for Docker compose scripts below.
40+
# We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub.
41+
DOCKER_REGISTRY: ghcr.io
3842
strategy:
3943
# Create a matrix of Node versions to test against (in parallel)
4044
matrix:
@@ -114,6 +118,14 @@ jobs:
114118
path: 'coverage/dspace-angular/lcov.info'
115119
retention-days: 14
116120

121+
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
122+
- name: Login to ${{ env.DOCKER_REGISTRY }}
123+
uses: docker/login-action@v3
124+
with:
125+
registry: ${{ env.DOCKER_REGISTRY }}
126+
username: ${{ github.repository_owner }}
127+
password: ${{ secrets.GITHUB_TOKEN }}
128+
117129
# Using "docker compose" start backend using CI configuration
118130
# and load assetstore from a cached copy
119131
- name: Start DSpace REST Backend via Docker (for e2e tests)

.github/workflows/docker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ on:
1616
pull_request:
1717

1818
permissions:
19-
contents: read # to fetch code (actions/checkout)
19+
contents: read # to fetch code (actions/checkout)
20+
packages: write # to write images to GitHub Container Registry (GHCR)
2021

2122
jobs:
2223
#############################################################

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This image will be published as dspace/dspace-angular
22
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
33

4-
FROM node:18-alpine
4+
FROM docker.io/node:18-alpine
55

66
# Ensure Python and other build tools are available
77
# These are needed to install some node modules, especially on linux/arm64
@@ -22,5 +22,5 @@ ENV NODE_OPTIONS="--max_old_space_size=4096"
2222
# Listen / accept connections from all IP addresses.
2323
# NOTE: At this time it is only possible to run Docker container in Production mode
2424
# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485
25-
ENV NODE_ENV development
25+
ENV NODE_ENV=development
2626
CMD npm run serve -- --host 0.0.0.0

Dockerfile.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Test build:
55
# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
66

7-
FROM node:18-alpine AS build
7+
FROM docker.io/node:18-alpine AS build
88

99
# Ensure Python and other build tools are available
1010
# These are needed to install some node modules, especially on linux/arm64
@@ -26,6 +26,6 @@ COPY --chown=node:node docker/dspace-ui.json /app/dspace-ui.json
2626

2727
WORKDIR /app
2828
USER node
29-
ENV NODE_ENV production
29+
ENV NODE_ENV=production
3030
EXPOSE 4000
3131
CMD pm2-runtime start dspace-ui.json --json

docker/cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ networks:
2121
external: true
2222
services:
2323
dspace-cli:
24-
image: "${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-latest}"
24+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-latest}"
2525
container_name: dspace-cli
2626
environment:
2727
# Below syntax may look odd, but it is how to override dspace.cfg settings via env variables.

docker/db.entities.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# # Therefore, it should be kept in sync with that file
1515
services:
1616
dspacedb:
17-
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
17+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
1818
environment:
1919
# This LOADSQL should be kept in sync with the URL in DSpace/DSpace
2020
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data

docker/docker-compose-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ services:
3333
# This allows us to generate statistics in e2e tests so that statistics pages can be tested thoroughly.
3434
solr__D__statistics__P__autoCommit: 'false'
3535
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
36-
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
36+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
3737
depends_on:
3838
- dspacedb
3939
networks:
@@ -60,7 +60,7 @@ services:
6060
# NOTE: This is customized to use our loadsql image, so that we are using a database with existing test data
6161
dspacedb:
6262
container_name: dspacedb
63-
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
63+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
6464
environment:
6565
# This LOADSQL should be kept in sync with the LOADSQL in
6666
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/db.entities.yml
@@ -81,7 +81,7 @@ services:
8181
# DSpace Solr container
8282
dspacesolr:
8383
container_name: dspacesolr
84-
image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
84+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
8585
networks:
8686
- dspacenet
8787
ports:

docker/docker-compose-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
DSPACE_REST_HOST: sandbox.dspace.org
2727
DSPACE_REST_PORT: 443
2828
DSPACE_REST_NAMESPACE: /server
29-
image: dspace/dspace-angular:${DSPACE_VER:-latest}-dist
29+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-latest}-dist"
3030
build:
3131
context: ..
3232
dockerfile: Dockerfile.dist

docker/docker-compose-rest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
4141
proxies__P__trusted__P__ipranges: '172.23.0'
4242
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
43-
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
43+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
4444
depends_on:
4545
- dspacedb
4646
networks:
@@ -68,7 +68,7 @@ services:
6868
dspacedb:
6969
container_name: dspacedb
7070
# Uses a custom Postgres image with pgcrypto installed
71-
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}"
71+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}"
7272
environment:
7373
PGDATA: /pgdata
7474
POSTGRES_PASSWORD: dspace
@@ -85,7 +85,7 @@ services:
8585
# DSpace Solr container
8686
dspacesolr:
8787
container_name: dspacesolr
88-
image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
88+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
8989
networks:
9090
- dspacenet
9191
ports:

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
DSPACE_REST_HOST: localhost
2424
DSPACE_REST_PORT: 8080
2525
DSPACE_REST_NAMESPACE: /server
26-
image: dspace/dspace-angular:${DSPACE_VER:-latest}
26+
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-latest}"
2727
build:
2828
context: ..
2929
dockerfile: Dockerfile

0 commit comments

Comments
 (0)