Skip to content

Commit

Permalink
WIP: Add Dockerfile
Browse files Browse the repository at this point in the history
This is prep for iterating on ostreedev#12
  • Loading branch information
cgwalters committed Oct 22, 2021
1 parent 621ca6a commit b5bfbc3
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ example

/target
Cargo.lock
.cosa
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM quay.io/coreos-assembler/fcos-buildroot:testing-devel as builder
WORKDIR /src
COPY . .
RUN make && make install DESTDIR=/build

FROM quay.io/coreos-assembler/coreos-assembler:latest
WORKDIR /srv
USER root
# Copy binaries from the build
COPY --from=builder /build /build
# Copy the build script
COPY --from=builder /src/ci/prow/fcos-e2e.sh /usr/bin/fcos-e2e
RUN /usr/bin/fcos-e2e
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
DESTDIR ?=
PREFIX ?= /usr
LIBEXECDIR ?= ${PREFIX}/libexec
RELEASE ?= 1

ifeq ($(RELEASE),1)
PROFILE ?= release
CARGO_ARGS = --release
else
PROFILE ?= debug
CARGO_ARGS =
endif

.PHONY: all
all:
cargo build ${CARGO_ARGS}

.PHONY: install
install:
mkdir -p "${DESTDIR}$(PREFIX)/bin" "${DESTDIR}$(LIBEXECDIR)"
install -D -t "${DESTDIR}$(PREFIX)/bin" target/${PROFILE}/ostree-ext-cli

install-tests:
install -D -m 0755 "${DESTDIR}$(PREFIX)/lib/coreos-assembler/tests/kola"
rsync -rlv tests/kolainst "${DESTDIR}$(PREFIX)/lib/coreos-assembler/tests/kola"
13 changes: 13 additions & 0 deletions ci/fcos-e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -xeuo pipefail

# Prow jobs don't support adding emptydir today
export COSA_SKIP_OVERLAY=1
# And suppress depcheck since we didn't install via RPM
export COSA_SUPPRESS_DEPCHECK=1
cd $(mktemp -d)
cosa init https://github.com/coreos/fedora-coreos-config/
rsync -rlv /build/ overrides/rootfs/
cosa fetch
cosa build
cosa kola run 'ext.rpm-ostree.*'
4 changes: 4 additions & 0 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Use this to quickly generate a new container image
# overriding the binaries from the local build.
FROM localhost/ostree-ext
COPY /src/target/debug/ostree-ext-cli /usr/bin/ostree-ext

0 comments on commit b5bfbc3

Please sign in to comment.