Skip to content

Commit 7d708cf

Browse files
committed
Fix nokogiri failed on arm64.
Uninstall nokogiri 1.16.x because of error "cannot load such file" asciidoctor/docker-asciidoctor#430
1 parent b632858 commit 7d708cf

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

.circleci/config.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,25 @@ workflows:
1010
context:
1111
- "github"
1212
- "Docker Hub"
13-
- example-build:
13+
- test:
1414
requires:
1515
- build
16+
matrix:
17+
parameters:
18+
platform:
19+
- linux/amd64
20+
- linux/arm64
21+
context:
22+
- "github"
23+
- "Docker Hub"
24+
- example-build:
25+
requires:
26+
- test
1627
context:
1728
- "github"
1829
- "Docker Hub"
1930
- example-deploy:
2031
requires:
21-
- build
2232
- example-build
2333
context:
2434
- "github"
@@ -50,6 +60,7 @@ jobs:
5060
build:
5161
machine:
5262
image: ubuntu-2204:2023.02.1
63+
resource_class: large
5364
steps:
5465
- setup
5566
- checkout
@@ -74,9 +85,31 @@ jobs:
7485
--no-cache \
7586
--progress=plain \
7687
--push .
88+
test:
89+
parameters:
90+
platform:
91+
type: enum
92+
enum: ["linux/amd64", "linux/arm64"]
93+
machine:
94+
image: ubuntu-2204:2023.02.1
95+
resource_class: medium
96+
steps:
97+
- run:
98+
name: Test docker image (<< parameters.platform >>)
99+
no_output_timeout: 1h
100+
command: |
101+
echo "${DOCKER_PASS}" | docker login -u "${DOCKER_USER}" --password-stdin
102+
docker pull ${DOCKER_USER}/asciidoctor:${CIRCLE_TAG:-latest}
103+
docker run --rm \
104+
-v $(pwd)/src/doc:/documents/ \
105+
-v $(pwd)/.examples/dist:/dist \
106+
--platform << parameters.platform >> \
107+
${DOCKER_USER}/asciidoctor:${CIRCLE_TAG:-latest} \
108+
inliner --help
77109
example-build:
78110
machine:
79111
image: ubuntu-2204:2023.02.1
112+
resource_class: large
80113
steps:
81114
- checkout
82115
- run:

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,22 @@ RUN apk --no-cache add \
213213
# 'Ruby' packages
214214
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
215215
# Install barby - @see: https://github.com/toretore/barby
216+
# (Re)Install nogokiri - @see: https://nokogiri.org/tutorials/installing_nokogiri.html#other-installation-scenarios
216217
# Install asciidoctor-multipage - @see: https://github.com/owenh000/asciidoctor-multipage
217218
# Install asciidoctor-lists - @see: https://github.com/Alwinator/asciidoctor-lists
218219
RUN apk add --no-cache --virtual .rubymakedepends \
219220
build-base \
220221
libxml2-dev \
222+
libxslt-dev \
221223
ruby-dev \
222224
&& gem install --no-document \
223225
barby rqrcode chunky_png \
224226
asciidoctor-multipage \
225227
asciidoctor-lists \
226-
&& apk del -r --no-cache .rubymakedepends
228+
&& apk del -r --no-cache .rubymakedepends \
229+
# @see: https://github.com/asciidoctor/docker-asciidoctor/issues/430
230+
# @see: https://github.com/asciidoctor/docker-asciidoctor/blob/d16e85e04c46ed02414565aa26b67a809f4c64c1/Dockerfile#L139
231+
&& if [[ ${TARGETARCH} == arm64 ]]; then gem uninstall nokogiri -v '> 1.14'; fi
227232

228233
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
229234
# 'Python' packages

0 commit comments

Comments
 (0)