Add a organic_development image.
This image will be shared by CI jobs rather than having a separate image for each, mirroring the developments I've done in natter.
This commit is contained in:
parent
4b85236c5f
commit
8e712532e1
@ -272,8 +272,8 @@ spec:
|
||||
serviceAccountName: build-bot
|
||||
params:
|
||||
- name: image-name
|
||||
value: "harbor.fizz.buzz/private/organic-clippy"
|
||||
value: "harbor.fizz.buzz/private/organic-development"
|
||||
- name: path-to-image-context
|
||||
value: docker/organic_clippy/
|
||||
value: docker/organic_development/
|
||||
- name: path-to-dockerfile
|
||||
value: docker/organic_clippy/Dockerfile
|
||||
value: docker/organic_development/Dockerfile
|
||||
|
6
docker/organic_development/Dockerfile
Normal file
6
docker/organic_development/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
||||
FROM rustlang/rust:nightly-alpine3.19 AS builder
|
||||
|
||||
RUN apk add --no-cache musl-dev
|
||||
RUN cargo install --locked --no-default-features --features ci-autoclean cargo-cache
|
||||
RUN rustup component add rustfmt
|
||||
RUN rustup component add clippy
|
33
docker/organic_development/Makefile
Normal file
33
docker/organic_development/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
SHELL := bash
|
||||
.ONESHELL:
|
||||
.SHELLFLAGS := -eu -o pipefail -c
|
||||
.DELETE_ON_ERROR:
|
||||
MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
ifeq ($(origin .RECIPEPREFIX), undefined)
|
||||
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
|
||||
endif
|
||||
.RECIPEPREFIX = >
|
||||
|
||||
IMAGE_NAME:=organic-development
|
||||
TARGET :=
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
> @grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -E 's/^([^:]*): *## */\1: /'
|
||||
|
||||
.PHONY: build
|
||||
build: ## Build the docker image.
|
||||
> docker build --tag $(IMAGE_NAME) --target=$(TARGET) --file Dockerfile .
|
||||
> docker volume create organic-cargo-registry
|
||||
|
||||
.PHONY: shell
|
||||
shell: ## Launch an interactive shell inside the docker image with the source repository mounted at /source.
|
||||
shell: build
|
||||
> docker run --rm -i -t --entrypoint /bin/sh --mount type=tmpfs,destination=/tmp -v "$$(readlink -f ../../):/source" --workdir=/source --env CARGO_TARGET_DIR=/target -v "organic-cargo-registry:/usr/local/cargo/registry" $(IMAGE_NAME)
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Remove the docker image and volume.
|
||||
> docker rmi $(IMAGE_NAME)
|
||||
> docker volume rm organic-cargo-registry
|
Loading…
Reference in New Issue
Block a user