public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] docker: Add binfmt-support for Isar cross-building
@ 2017-09-05  8:58 Jan Kiszka
  2017-09-05  9:00 ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2017-09-05  8:58 UTC (permalink / raw)
  To: kas-devel; +Cc: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Additionally requires to run the container with --privileged - not nice but
unavoidable right now, see also
https://groups.google.com/forum/#!topic/isar-users/Un75m49InjY

Also note that running containers with different binfmt settings
concurrently will cause troubles. Same for the case that the host
requires deviating settings. Use carefully.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Clearly no long-term solution, but as long as we need binfmt and want to
use Docker at least as packaging helper (not for isolation), this is
required.

 Dockerfile.isar | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Dockerfile.isar b/Dockerfile.isar
index 0119720..ea644b4 100644
--- a/Dockerfile.isar
+++ b/Dockerfile.isar
@@ -10,7 +10,7 @@ RUN apt-get update && \
     apt-get install -y -f --no-install-recommends --target-release jessie \
             autoconf automake gdisk libtool bash-completion \
             sudo grub2 grub-efi-amd64-bin grub-efi-ia32-bin qemu-user-static \
-            reprepro python3 && \
+            reprepro python3 binfmt-support && \
     apt-get install -y -f --no-install-recommends --target-release jessie-backports \
             e2fsprogs && \
     apt-get install -y -f --no-install-recommends --target-release stretch \
@@ -20,3 +20,5 @@ RUN apt-get update && \
 
 RUN echo "builder ALL=NOPASSWD: ALL" > /etc/sudoers.d/builder-nopasswd && \
     chmod 660 /etc/sudoers.d/builder-nopasswd
+
+RUN sed -i "s|#!/bin/bash|\0\n\nupdate-binfmts --enable|" /kas/docker-entrypoint
-- 
2.12.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docker: Add binfmt-support for Isar cross-building
  2017-09-05  8:58 [PATCH] docker: Add binfmt-support for Isar cross-building Jan Kiszka
@ 2017-09-05  9:00 ` Jan Kiszka
  2017-09-06 15:26   ` Daniel Wagner
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2017-09-05  9:00 UTC (permalink / raw)
  To: kas-devel; +Cc: isar-users

On 2017-09-05 10:58, [ext] Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Additionally requires to run the container with --privileged - not nice but
> unavoidable right now, see also
> https://groups.google.com/forum/#!topic/isar-users/Un75m49InjY
> 
> Also note that running containers with different binfmt settings
> concurrently will cause troubles. Same for the case that the host
> requires deviating settings. Use carefully.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> Clearly no long-term solution, but as long as we need binfmt and want to
> use Docker at least as packaging helper (not for isolation), this is
> required.
> 
>  Dockerfile.isar | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Dockerfile.isar b/Dockerfile.isar
> index 0119720..ea644b4 100644
> --- a/Dockerfile.isar
> +++ b/Dockerfile.isar
> @@ -10,7 +10,7 @@ RUN apt-get update && \
>      apt-get install -y -f --no-install-recommends --target-release jessie \
>              autoconf automake gdisk libtool bash-completion \
>              sudo grub2 grub-efi-amd64-bin grub-efi-ia32-bin qemu-user-static \
> -            reprepro python3 && \
> +            reprepro python3 binfmt-support && \
>      apt-get install -y -f --no-install-recommends --target-release jessie-backports \
>              e2fsprogs && \
>      apt-get install -y -f --no-install-recommends --target-release stretch \
> @@ -20,3 +20,5 @@ RUN apt-get update && \
>  
>  RUN echo "builder ALL=NOPASSWD: ALL" > /etc/sudoers.d/builder-nopasswd && \
>      chmod 660 /etc/sudoers.d/builder-nopasswd
> +
> +RUN sed -i "s|#!/bin/bash|\0\n\nupdate-binfmts --enable|" /kas/docker-entrypoint
> 

I should have noted that I just successfully build an arm image inside a
docker container this way. It boots in QEMU.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] docker: Add binfmt-support for Isar cross-building
  2017-09-05  9:00 ` Jan Kiszka
@ 2017-09-06 15:26   ` Daniel Wagner
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Wagner @ 2017-09-06 15:26 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: kas-devel, isar-users

Hi Jan,

Jan Kiszka <jan.kiszka@siemens.com> writes:

> On 2017-09-05 10:58, [ext] Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>> 
>> Additionally requires to run the container with --privileged - not nice but
>> unavoidable right now, see also
>> https://groups.google.com/forum/#!topic/isar-users/Un75m49InjY
>> 
>> Also note that running containers with different binfmt settings
>> concurrently will cause troubles. Same for the case that the host
>> requires deviating settings. Use carefully.

Patch applied on next.

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-06 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05  8:58 [PATCH] docker: Add binfmt-support for Isar cross-building Jan Kiszka
2017-09-05  9:00 ` Jan Kiszka
2017-09-06 15:26   ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox