Skip to content

Commit aeb67b5

Browse files
authored
chore: update docker image (#336)
1 parent a9b94df commit aeb67b5

File tree

4 files changed

+75
-21
lines changed

4 files changed

+75
-21
lines changed

.github/workflows/docker-ci.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build and test docker image
2+
on:
3+
pull_request:
4+
paths:
5+
- Dockerfile
6+
branches:
7+
- master
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
jobs:
12+
build_docker_image:
13+
name: Build docker image
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@v2
18+
- run: sudo chown runner:docker /var/run/docker.sock
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
- name: Build docker image
22+
uses: docker/build-push-action@v5
23+
with:
24+
tags: oryd/sdk:${{ github.sha }}
25+
push: false
26+
outputs: type=docker,dest=./sdk.tar
27+
- name: upload artifacts
28+
uses: actions/upload-artifact@v2
29+
with:
30+
name: oryd-sdk-${{ github.sha }}
31+
path: ./sdk.tar
32+
- name: run generate.sh and test.sh
33+
run: |
34+
docker load --input ./sdk.tar
35+
rm ./sdk.tar
36+
docker run --mount type=bind,source="$(pwd)",target=/project -e FORCE_PROJECT=client -e FORCE_VERSION=$(cat ./spec/client/latest) -i oryd/sdk:${{ github.sha }} /bin/sh -c "cd /project && ./scripts/generate.sh && ./scripts/test.sh"

Dockerfile

+9-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
FROM openjdk:15-buster
1+
# can't use bookworm (latest LTS as of June23) yet, as elixir/erlang does not provide packages for it yet. Check if https://binaries.erlang-solutions.com/debian/dists/bookworm/ is available to change this
2+
FROM openjdk:21-bullseye
23

34
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates ssh bash
45

6+
COPY scripts/build ./scripts
7+
58
ENV GOLANG_VERSION 1.17
69

710
RUN set -eux; \
@@ -50,10 +53,10 @@ ENV GO111MODULE=on
5053

5154
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
5255

53-
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - && apt-get install -y nodejs
56+
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
5457
# the following is a workaround for openjdk-11-jre-headless erroring due to not having a man path in slim-debian
5558
RUN apt-get update -y
56-
RUN apt-get install -y --no-install-recommends python3 python3-dev python3-pip ruby jq gnupg git gettext libffi6 libffi-dev libssl-dev php composer php-curl php7.3-tokenizer php-dom php-xml php-simplexml php-xmlwriter maven pkg-config
59+
RUN apt-get install -y --no-install-recommends python3 python3-dev python3-pip ruby jq gnupg git gettext libffi-dev libssl-dev php composer php-curl php-dom php-xml php-simplexml php-xmlwriter maven pkg-config twine
5760
# RUN apk add -U --no-cache ca-certificates bash nodejs npm python3 python3-dev py-pip ruby jq build-base gnupg git openssh curl gettext libffi libffi-dev openssl-dev php composer php-curl php7-tokenizer wget php-dom php-xml php-simplexml php-xmlwriter maven
5861

5962
# https://stackoverflow.com/questions/35736598/cannot-pip-install-cryptography-in-docker-alpine-linux-3-3-with-openssl-1-0-2g
@@ -72,8 +75,6 @@ RUN apt-get install -y --no-install-recommends python3 python3-dev python3-pip r
7275
RUN npm install -g [email protected]
7376
RUN npm i -g @openapitools/openapi-generator-cli
7477
RUN openapi-generator-cli version-manager set 5.2.1
75-
RUN python3 -m pip install --upgrade pip
76-
RUN python3 -m pip install --user --upgrade setuptools wheel twine
7778

7879
# dotnet
7980
ENV PATH "$PATH:/root/.dotnet"
@@ -88,19 +89,10 @@ RUN apt-get install -y --no-install-recommends \
8889
&& rm dotnet-install.sh
8990

9091
# dart
91-
RUN \
92-
apt-get -q update && apt-get install --no-install-recommends -y -q gnupg2 curl git ca-certificates apt-transport-https openssh-client && \
93-
curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
94-
curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
95-
apt-get update && \
96-
apt-get install dart=2.19.6-1
92+
RUN ./scripts/install-dart.sh
9793

9894
# elixir
99-
RUN \
100-
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && \
101-
dpkg -i erlang-solutions_2.0_all.deb && \
102-
apt-get -q update && apt-get install --no-install-recommends -y -q esl-erlang elixir && \
103-
rm erlang-solutions_2.0_all.deb && \
95+
RUN apt-get -q update && apt-get install -y -q elixir && \
10496
mix local.hex --force
10597

10698
# rust
@@ -124,7 +116,7 @@ RUN td=$(mktemp) \
124116

125117
RUN gem install bundler -v 2.3.26 && \
126118
apt-get update && \
127-
apt-get install -y --no-install-recommends ruby-dev
119+
apt-get install -y --no-install-recommends ruby-dev=1:2.7+2
128120

129121
ADD go.mod go.mod
130122
ADD go.sum go.sum
@@ -133,4 +125,3 @@ RUN go build -o /usr/local/bin/ory github.com/ory/cli
133125
RUN swagger version
134126
RUN ory version
135127

136-
ENTRYPOINT /bin/bash

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ docker run --platform linux/amd64 --mount type=bind,source="$(pwd)",target=/proj
3838

3939
### Debugging Failing Tests on CI
4040

41-
If a tests fails on CI, you may run the following code snippet to reproduce the failure locally:
41+
If a test fails in CI, you may run the following code snippet to reproduce the failure locally:
4242

4343
```shell script
44-
docker run --platform linux/amd64 --mount type=bind,source="$(pwd)",target=/project --name sdk -it oryd/sdk:v0.0.51 /bin/sh
44+
docker run --platform linux/amd64 --mount type=bind,source="$(pwd)",target=/project --name sdk -it oryd/sdk:v0.0.51 /bin/bash
4545

46-
export FORCE_VERSION=v1.2.17
4746
export FORCE_PROJECT=client # or hydra or something else
47+
export FORCE_VERSION=$(cat /project/spec/$FORCE_PROJECT/latest) # or a specific version, e.g. v1.2.17
4848
cd /project
4949

5050
./scripts/generate.sh

scripts/build/install-dart.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Check the platform architecture
6+
if [[ $(uname -m) == "x86_64" ]]; then
7+
# Download the x64 Dart SDK
8+
curl -L https://storage.googleapis.com/dart-archive/channels/stable/release/3.3.0/sdk/dartsdk-linux-x64-release.zip -o dart-sdk.zip
9+
# Add your installation steps here
10+
else
11+
# Download the ARM Dart SDK
12+
curl -L https://storage.googleapis.com/dart-archive/channels/stable/release/3.3.0/sdk/dartsdk-linux-arm64-release.zip -o dart-sdk.zip
13+
# Add your installation steps here
14+
fi
15+
16+
# Unzip the downloaded file
17+
unzip dart-sdk.zip
18+
19+
# Remove the downloaded file
20+
rm dart-sdk.zip
21+
22+
mkdir -p /usr/lib/dart
23+
# Move the Dart SDK to the /usr/lib/dart directory
24+
mv -v dart-sdk/* /usr/lib/dart
25+
26+
# Add the Dart SDK to the PATH
27+
echo 'export PATH="$PATH:/usr/lib/dart/bin"' >> ~/.bashrc

0 commit comments

Comments
 (0)