Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update erlang with multiple architectures #3415

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

tianon
Copy link
Member

@tianon tianon commented Sep 6, 2017

@tianon
Copy link
Member Author

tianon commented Sep 6, 2017

Diff:
diff --git a/_bashbrew-arches b/_bashbrew-arches
index 6385195..42f20c4 100644
--- a/_bashbrew-arches
+++ b/_bashbrew-arches
@@ -1,9 +1,45 @@
 erlang:17 @ amd64
+erlang:17 @ arm32v7
+erlang:17 @ arm64v8
+erlang:17 @ i386
+erlang:17 @ ppc64le
+erlang:17 @ s390x
 erlang:17-slim @ amd64
+erlang:17-slim @ arm32v7
+erlang:17-slim @ arm64v8
+erlang:17-slim @ i386
+erlang:17-slim @ ppc64le
+erlang:17-slim @ s390x
 erlang:18 @ amd64
+erlang:18 @ arm32v7
+erlang:18 @ arm64v8
+erlang:18 @ i386
+erlang:18 @ s390x
 erlang:18-slim @ amd64
+erlang:18-slim @ arm32v7
+erlang:18-slim @ arm64v8
+erlang:18-slim @ i386
+erlang:18-slim @ s390x
 erlang:19 @ amd64
+erlang:19 @ arm32v7
+erlang:19 @ arm64v8
+erlang:19 @ i386
+erlang:19 @ s390x
 erlang:19-slim @ amd64
+erlang:19-slim @ arm32v7
+erlang:19-slim @ arm64v8
+erlang:19-slim @ i386
+erlang:19-slim @ s390x
 erlang:alpine @ amd64
 erlang:latest @ amd64
+erlang:latest @ arm32v7
+erlang:latest @ arm64v8
+erlang:latest @ i386
+erlang:latest @ ppc64le
+erlang:latest @ s390x
 erlang:slim @ amd64
+erlang:slim @ arm32v7
+erlang:slim @ arm64v8
+erlang:slim @ i386
+erlang:slim @ ppc64le
+erlang:slim @ s390x
diff --git a/erlang_17-slim/Dockerfile b/erlang_17-slim/Dockerfile
index a837b90..a1d46e4 100644
--- a/erlang_17-slim/Dockerfile
+++ b/erlang_17-slim/Dockerfile
@@ -15,6 +15,7 @@ RUN set -xe \
 		curl \
 		ca-certificates \
 		autoconf \
+		dpkg-dev \
 		gcc \
 		make \
 		libncurses-dev \
@@ -31,7 +32,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& cd /usr/src/otp-src \
 	&& ./otp_build autoconf \
-	&& ./configure \
+	&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	&& ./configure --build="$gnuArch" \
 	&& make -j$(nproc) \
 	&& make install \
 	&& find /usr/local -name examples | xargs rm -rf \
diff --git a/erlang_17/Dockerfile b/erlang_17/Dockerfile
index 66a3665..389015d 100644
--- a/erlang_17/Dockerfile
+++ b/erlang_17/Dockerfile
@@ -19,7 +19,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& cd /usr/src/otp-src \
 	&& ./otp_build autoconf \
-	&& ./configure \
+	&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	&& ./configure --build="$gnuArch" \
 	&& make -j$(nproc) \
 	&& make install \
 	&& find /usr/local -name examples | xargs rm -rf \
diff --git a/erlang_18-slim/Dockerfile b/erlang_18-slim/Dockerfile
index 16a8415..a8f7a37 100644
--- a/erlang_18-slim/Dockerfile
+++ b/erlang_18-slim/Dockerfile
@@ -16,6 +16,7 @@ RUN set -xe \
 		curl \
 		ca-certificates \
 		autoconf \
+		dpkg-dev \
 		gcc \
 		make \
 		libncurses-dev \
@@ -33,7 +34,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& cd /usr/src/otp-src \
 	&& ./otp_build autoconf \
-	&& ./configure --enable-sctp \
+	&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	&& ./configure --build="$gnuArch" --enable-sctp \
 	&& make -j$(nproc) \
 	&& make install \
 	&& find /usr/local -name examples | xargs rm -rf \
diff --git a/erlang_18/Dockerfile b/erlang_18/Dockerfile
index df988d3..0133530 100644
--- a/erlang_18/Dockerfile
+++ b/erlang_18/Dockerfile
@@ -21,7 +21,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& cd /usr/src/otp-src \
 	&& ./otp_build autoconf \
-	&& ./configure --enable-sctp \
+	&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	&& ./configure --build="$gnuArch" --enable-sctp \
 	&& make -j$(nproc) \
 	&& make install \
 	&& find /usr/local -name examples | xargs rm -rf \
diff --git a/erlang_19-slim/Dockerfile b/erlang_19-slim/Dockerfile
index 81f08d7..dadd01f 100644
--- a/erlang_19-slim/Dockerfile
+++ b/erlang_19-slim/Dockerfile
@@ -17,6 +17,7 @@ RUN set -xe \
 		curl \
 		ca-certificates \
 		autoconf \
+		dpkg-dev \
 		gcc \
 		make \
 		libncurses-dev \
@@ -35,7 +36,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& cd /usr/src/otp-src \
 	&& ./otp_build autoconf \
-	&& ./configure \
+	&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	&& ./configure --build="$gnuArch" \
 		--enable-dirty-schedulers \
 	&& make -j$(nproc) \
 	&& make install \
diff --git a/erlang_19/Dockerfile b/erlang_19/Dockerfile
index 6823578..3418e28 100644
--- a/erlang_19/Dockerfile
+++ b/erlang_19/Dockerfile
@@ -23,7 +23,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& cd /usr/src/otp-src \
 	&& ./otp_build autoconf \
-	&& ./configure \
+	&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	&& ./configure --build="$gnuArch" \
 		--enable-dirty-schedulers \
 	&& make -j$(nproc) \
 	&& make install \
diff --git a/erlang_alpine/Dockerfile b/erlang_alpine/Dockerfile
index 0d0a45b..d4ac7fb 100644
--- a/erlang_alpine/Dockerfile
+++ b/erlang_alpine/Dockerfile
@@ -11,6 +11,7 @@ RUN set -xe \
 	&& curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \
 	&& echo "$OTP_DOWNLOAD_SHA256  otp-src.tar.gz" | sha256sum -c - \
 	&& apk add --no-cache --virtual .build-deps \
+		dpkg-dev dpkg \
 		gcc \
 		g++ \
 		libc-dev \
@@ -28,7 +29,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& ( cd $ERL_TOP \
 	  && ./otp_build autoconf \
-	  && ./configure \
+	  && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	  && ./configure --build="$gnuArch" \
 	  && make -j$(getconf _NPROCESSORS_ONLN) \
 	  && make install ) \
 	&& rm -rf $ERL_TOP \
@@ -39,7 +41,7 @@ RUN set -xe \
 		/usr/local/lib/erlang/erts*/lib/lib*.a \
 		/usr/local/lib/erlang/usr/lib/lib*.a \
 		/usr/local/lib/erlang/lib/*/lib/lib*.a \
-	&& scanelf --nobanner -E ET_EXEC -BF '%F' --recursive /usr/local | xargs strip --strip-all \
+	&& scanelf --nobanner -E ET_EXEC -BF '%F' --recursive /usr/local | xargs -r strip --strip-all \
 	&& scanelf --nobanner -E ET_DYN -BF '%F' --recursive /usr/local | xargs -r strip --strip-unneeded \
 	&& runDeps=$( \
 		scanelf --needed --nobanner --recursive /usr/local \
diff --git a/erlang_latest/Dockerfile b/erlang_latest/Dockerfile
index fd662e9..2065423 100644
--- a/erlang_latest/Dockerfile
+++ b/erlang_latest/Dockerfile
@@ -24,7 +24,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& ( cd $ERL_TOP \
 	  && ./otp_build autoconf \
-	  && ./configure \
+	  && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	  && ./configure --build="$gnuArch" \
 	  && make -j$(nproc) \
 	  && make install ) \
 	&& find /usr/local -name examples | xargs rm -rf \
diff --git a/erlang_slim/Dockerfile b/erlang_slim/Dockerfile
index f44b42d..788efb1 100644
--- a/erlang_slim/Dockerfile
+++ b/erlang_slim/Dockerfile
@@ -21,6 +21,7 @@ RUN set -xe \
 	' \
 	&& buildDeps=' \
 		autoconf \
+		dpkg-dev \
 		gcc \
 		g++ \
 		make \
@@ -39,7 +40,8 @@ RUN set -xe \
 	&& rm otp-src.tar.gz \
 	&& ( cd $ERL_TOP \
 	  && ./otp_build autoconf \
-	  && ./configure \
+	  && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
+	  && ./configure --build="$gnuArch" \
 	  && make -j$(nproc) \
 	  && make install ) \
 	&& find /usr/local -name examples | xargs rm -rf \

@tianon
Copy link
Member Author

tianon commented Sep 6, 2017

Build test of #3415; 75293bd (erlang):

$ bashbrew build erlang:20.0.4
Building bashbrew/cache:184b0947109a05704e58cc96277128399ffc58b7edc6d4b4bae6474af1a11fb1 (erlang:20.0.4)
Tagging erlang:20.0.4
Tagging erlang:20.0
Tagging erlang:20
Tagging erlang:latest

$ test/run.sh erlang:20.0.4
testing erlang:20.0.4
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed


$ bashbrew build erlang:20.0.4-slim
Building bashbrew/cache:634f038b0729ab6ba1d520ce69d952f538f3a13eedc95670c59e05a6fd242804 (erlang:20.0.4-slim)
Tagging erlang:20.0.4-slim
Tagging erlang:20.0-slim
Tagging erlang:20-slim
Tagging erlang:slim

$ test/run.sh erlang:20.0.4-slim
testing erlang:20.0.4-slim
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed


$ bashbrew build erlang:20.0.4-alpine
Building bashbrew/cache:2c5aed894660764eeab802d26b5ed4a588bc073dc82b260fc9ab542a25f0cfc2 (erlang:20.0.4-alpine)
Tagging erlang:20.0.4-alpine
Tagging erlang:20.0-alpine
Tagging erlang:20-alpine
Tagging erlang:alpine

$ test/run.sh erlang:20.0.4-alpine
testing erlang:20.0.4-alpine
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed


$ bashbrew build erlang:19.3.6.2
Building bashbrew/cache:78ece006c360c121bf11b5ffd51e9df201b0601845c2e9eedd307809267715f6 (erlang:19.3.6.2)
Tagging erlang:19.3.6.2
Tagging erlang:19.3.6
Tagging erlang:19.3
Tagging erlang:19

$ test/run.sh erlang:19.3.6.2
testing erlang:19.3.6.2
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed


$ bashbrew build erlang:19.3.6.2-slim
Building bashbrew/cache:4e5064a844aea5a8e3b2d441c5956311246c99a8cff2727f67a2529052b13232 (erlang:19.3.6.2-slim)
Tagging erlang:19.3.6.2-slim
Tagging erlang:19.3.6-slim
Tagging erlang:19.3-slim
Tagging erlang:19-slim

$ test/run.sh erlang:19.3.6.2-slim
testing erlang:19.3.6.2-slim
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed


$ bashbrew build erlang:18.3.4.5
Building bashbrew/cache:83cd53ce6109b8d507e470b373d87fafd26a6504fa8ce36abdb67c9c591d37ba (erlang:18.3.4.5)
Tagging erlang:18.3.4.5
Tagging erlang:18.3.4
Tagging erlang:18.3
Tagging erlang:18

$ test/run.sh erlang:18.3.4.5
testing erlang:18.3.4.5
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed


$ bashbrew build erlang:18.3.4.5-slim
Building bashbrew/cache:cc4a573f54f4e69200184d7bb833c4381a7a7c753609a2f16ef52cf40341544c (erlang:18.3.4.5-slim)
Tagging erlang:18.3.4.5-slim
Tagging erlang:18.3.4-slim
Tagging erlang:18.3-slim
Tagging erlang:18-slim

$ test/run.sh erlang:18.3.4.5-slim
testing erlang:18.3.4.5-slim
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed


$ bashbrew build erlang:17.5.6.9
Building bashbrew/cache:05962c70d3eea31702e32891a682a4a5e58cfe6ad93e8f9f01fe7503c4ea1ab2 (erlang:17.5.6.9)
Tagging erlang:17.5.6.9
Tagging erlang:17.5.6
Tagging erlang:17.5
Tagging erlang:17

$ test/run.sh erlang:17.5.6.9
testing erlang:17.5.6.9
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed


$ bashbrew build erlang:17.5.6.9-slim
Building bashbrew/cache:3eb944c8a13a1a6ccb85cb84b32e2cfa58f6de0fb4f1f47aebea1e3d1d9f11f9 (erlang:17.5.6.9-slim)
Tagging erlang:17.5.6.9-slim
Tagging erlang:17.5.6-slim
Tagging erlang:17.5-slim
Tagging erlang:17-slim

$ test/run.sh erlang:17.5.6.9-slim
testing erlang:17.5.6.9-slim
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'erlang-hello-world' [5/5]...passed

@yosifkit yosifkit merged commit f48d3e2 into docker-library:master Sep 6, 2017
@yosifkit yosifkit deleted the erlang branch September 6, 2017 21:52
@c0b
Copy link
Contributor

c0b commented Sep 19, 2017

@tianon @yosifkit please have look erlang/docker-erlang-otp#75 (comment) MANIFEST_UNKNOWN issue; someone suspect it relates to the recent multiple architectures, but I feel it's a registry operation issue? so far found only on erlang:20.0.5 or any newer tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants