adds docker image
Some checks reported errors
continuous-integration/drone Build was killed

Signed-off-by: Jochen maes <jochen@sejo-it.be>
This commit is contained in:
Jochen Maes 2023-10-21 11:32:38 +02:00
parent e3de1ee618
commit 497742f9ac
2 changed files with 47 additions and 0 deletions

20
.drone.yml Normal file
View File

@ -0,0 +1,20 @@
---
kind: pipeline
type: docker
name: docker-task-rust
platform:
arch: amd64
steps:
- name: docker build
image: plugins/docker
settings:
username: sejo
password:
from_secret: gitea_token
registry: https://gitea.sejo-it.be
repo: sejo-it/drone-task-rust
tags:
- latest
- master

27
Dockerfile Normal file
View File

@ -0,0 +1,27 @@
# Base image. Change this to use another Rust version.
FROM rust:1.73-slim
# Install Docker (for docker-in-docker)
RUN apt-get update \
&& apt-get install -y ca-certificates curl gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bullseye stable" >> /etc/apt/sources.list.d/docker.list \
&& apt-get update \
&& apt-get install -y docker-ce-cli \
&& apt-get clean
# Install cross v0.2.4
RUN mkdir -p /usr/local/cargo/bin && curl -L https://github.com/cross-rs/cross/releases/download/v0.2.4/cross-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C /usr/local/cargo/bin
# (Optional) Pre-install rust targets
# This significantly reduces build time, at the cost of an increased image size
RUN rustup target add \
aarch64-unknown-linux-gnu \
aarch64-unknown-linux-musl \
x86_64-unknown-linux-gnu \
x86_64-unknown-linux-musl \
&& rustup component add --target aarch64-unknown-linux-gnu rust-src \
&& rustup component add --target aarch64-unknown-linux-musl rust-src \
&& rustup component add --target x86_64-unknown-linux-gnu rust-src \
&& rustup component add --target x86_64-unknown-linux-musl rust-src