Commit 94285641 authored by Stefan Lankes's avatar Stefan Lankes
Browse files

build container image with loader

- build image from scratch
parent c649f4cb
Pipeline #464709 passed with stages
in 4 minutes and 14 seconds
stages:
- prepare
- build
- deploy
variables:
DOCKER_FILE: Dockerfile
DOCKER_TAG: latest
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}
IMAGE: ${CI_REGISTRY_IMAGE}
GIT_SUBMODULE_STRATEGY: normal
FF_GITLAB_REGISTRY_HELPER_IMAGE: 1
.prepare:docker: &prepare_docker
stage: prepare
image:
name: docker
before_script:
- docker version
- docker login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
script:
- docker build -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}:${DOCKER_TAG} .
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
tags:
- docker
prepare:docker:
<<: *prepare_docker
build:loader:
stage: build
image: ${CI_REGISTRY_IMAGE}
script:
- make release=1
artifacts:
paths:
- target/x86_64-unknown-hermit-loader/release/rusty-loader
.deploy:loader: &loader
stage: deploy
dependencies:
- build:loader
image:
name: docker
before_script:
- docker version
- docker login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
script:
- |
cat << END > ${DOCKER_FILE}
FROM scratch
ADD target/x86_64-unknown-hermit-loader/release/rusty-loader /hermit/
END
- docker build -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}/loader:latest .
- docker push ${DOCKER_IMAGE}/loader:latest
tags:
- docker
only:
refs:
- master
deploy:loader:
<<: *loader
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y install cpu-checker util-linux apt-transport-https curl wget binutils build-essential gcc libtool bsdmainutils pkg-config libssl-dev git qemu-kvm qemu-system-x86 nasm seabios qemu-utils fdisk grub-pc grub-pc-bin grub-imageboot grub-legacy-ec2 multiboot kpartx gzip && \
apt-get clean
# Install Rust toolchain
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --profile minimal
RUN /root/.cargo/bin/cargo install cargo-download
ENV PATH="/root/.cargo/bin:/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/:${PATH}"
ENV EDITOR=vim
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment