Skip to content

Commit 93b6c36

Browse files
committed
Fix architecture builds
1 parent 74f8303 commit 93b6c36

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

.github/workflows/params.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ env:
2323
"0.13.0",
2424
"0.12.1",
2525
"0.12.0",
26+
],
27+
"FLAVOUR": ["latest"],
28+
"ARCH": ["linux/amd64", "linux/386", "linux/arm64", "linux/arm/v7", "linux/arm/v6"]
29+
},
30+
{
31+
"NAME": "tfdocs",
32+
"VERSION": [
2633
"0.11.2",
2734
"0.11.1",
2835
"0.11.0",
@@ -40,7 +47,7 @@ env:
4047
"0.4.0"
4148
],
4249
"FLAVOUR": ["latest"],
43-
"ARCH": ["linux/amd64", "linux/386", "linux/arm64", "linux/arm/v7", "linux/arm/v6"]
50+
"ARCH": ["linux/amd64"]
4451
}
4552
]
4653

Dockerfiles/Dockerfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN set -x \
66
bash \
77
ca-certificates \
88
curl \
9+
dpkg \
910
gcc \
1011
git \
1112
make \
@@ -27,8 +28,23 @@ RUN set -x \
2728
\
2829
# Build
2930
&& go mod download \
30-
&& make build \
31-
&& mv /go/src/github.com/terraform-docs/bin//linux-amd64/terraform-docs /usr/local/bin/terraform-docs
31+
&& make build
32+
33+
RUN set -x \
34+
&& dpkg --print-architecture \
35+
\
36+
# Copy correct architecture
37+
&& if [ "$(dpkg --print-architecture | awk -F'-' '{print $NF}' )" = "i386" ]; then\
38+
mv /go/src/github.com/terraform-docs/bin/linux-386/terraform-docs /usr/local/bin/terraform-docs; \
39+
elif [ "$(uname -m)" = "x86_64" ]; then \
40+
mv /go/src/github.com/terraform-docs/bin/linux-amd64/terraform-docs /usr/local/bin/terraform-docs; \
41+
elif [ "$(uname -m)" = "aarch64" ]; then \
42+
mv /go/src/github.com/terraform-docs/bin/linux-arm64/terraform-docs /usr/local/bin/terraform-docs; \
43+
elif [ "$(uname -m)" = "armv7l" ]; then \
44+
mv /go/src/github.com/terraform-docs/bin/linux-arm/terraform-docs /usr/local/bin/terraform-docs; \
45+
else \
46+
mv /go/src/github.com/terraform-docs/bin/linux-$(uname -m)/terraform-docs /usr/local/bin/terraform-docs; \
47+
fi
3248

3349
# Version pre-check
3450
RUN set -x \

0 commit comments

Comments
 (0)