openeuler-image-cross-build

command module
v0.0.0-...-c8ad551 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

openEuler-image-cross-build

This is the second project of openEuler hackathon game. This project is a tool to build the cross-platform docker images. At the moment, you can use this project to build an aarch64 docker image in the x86 platform without any modification of Dockerfile.

Prerequisites

This project is developed and tested in Huawei cloud server, and the OS is CentOS 7.6-x86_64. Docker daemon is required when the software is running. Docker 19.03.5 is recommended.

How to use it

  1. Run sh prepare.sh to get qemu-aarch64-static and set binfmt_misc function.
  2. Copy qemu-aarch64-static to the directory that you want to build a docker image.
  3. Run go install to install the project.
  4. You can run openEuler-image-cross-build pull imagename, openEuler-image-cross-build push imagename and openEuler-image-cross-build build -f dockerfilename -t imagetag directory like docker.

Example

The example folder is an example to use this project to build an aarch64 httpd image based on openEuler 1.0 OS image in x86_64 platform.

  1. Run docker daemon and finish prepare work as How to use it chapter.
  2. Run openEuler-image-cross-build pull huaxinlu/openeulergame2019:v3.1. This is a public image, so the username and password are empty.
  3. Copy qemu-aarch64-static to the example folder and run openEuler-image-cross-build build -t httpd-openeuler-example example/ to build the image.
  4. Because the binfmt_misc is set, you can test this image in host. Firstly, run the image using docker run -d -p 80:80 httpd-openeuler-example. Then run curl http://localhost:80, and "Hello World!" is printed in the screen.
  5. You can also push image to your respository using openEuler-image-cross-build push tag/of/your/image. The username and password are needed during pushing.

Documentation

Overview

Copyright © 2020 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL