feat(rust): add rust compiler

This commit is contained in:
Markus Pesch 2019-08-19 18:28:06 +02:00
parent 520c35bbfe
commit f7af2d5785
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
4 changed files with 30 additions and 6 deletions

View File

@ -2,4 +2,4 @@ services:
- docker - docker
script: script:
- make push - make image-push

View File

@ -5,4 +5,12 @@ RUN pacman --sync \
--noconfirm \ --noconfirm \
--sysupgrade go gcc make git go-bindata --sysupgrade go gcc make git go-bindata
RUN curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh && \
chmod +x /tmp/rustup.sh && \
/tmp/rustup.sh -y && \
source ${HOME}/.cargo/env && \
rustup target add x86_64-unknown-linux-musl
ENV PATH='/root/.cargo/bin:${PATH}'
WORKDIR /workspace WORKDIR /workspace

View File

@ -1,17 +1,17 @@
# VERSION # VERSION
# If no version is specified as a parameter of make, the value latest # If no version is specified as a parameter of make, the value latest
# is taken. # is taken.
VERSION:=$(or ${TRAVIS_TAG}, ${TRAVIS_TAG}, latest) VERSION:=$(or ${TRAVIS_TAG}, latest)
# DOCKER_USER # DOCKER_USER
DOCKER_USER:=volkerraschek DOCKER_USER:=volkerraschek
build: image-build:
docker build \ docker build \
--no-cache \ --no-cache \
--tag ${DOCKER_USER}/build-image:${VERSION} \ --tag ${DOCKER_USER}/build-image:${VERSION} \
. .
push: build image-push: image-build
docker login --username ${DOCKER_USER} --password ${DOCKER_PASSWORD} docker login --username ${DOCKER_USER} --password ${DOCKER_PASSWORD}
docker push ${DOCKER_USER}/build-image:${VERSION} docker push ${DOCKER_USER}/build-image:${VERSION}

View File

@ -1,12 +1,28 @@
# build-image [![Build Status](https://travis-ci.com/volker-raschek/build-image.svg?branch=master)](https://travis-ci.com/volker-raschek/build-image) # build-image [![Build Status](https://travis-ci.com/volker-raschek/build-image.svg?branch=master)](https://travis-ci.com/volker-raschek/build-image)
This project contains only files to build a build container image. This project contains only files to build a build container image.
## golang ## golang
Execute this in your root folder of your go project.
To use this image for building golang applications execute this in your root
folder of your go project.
```bash ```bash
$ docker run \ $ docker run \
--rm \ --rm \
--volume ${PWD}:/workspace \ --volume ${PWD}:/workspace \
volkerraschek/build-image:latest \ volkerraschek/build-image:latest \
go build go build
``` ```
## rust
If you want to compile instead go rust sourcecode, than you can do it similar to the golang example.
```bash
$ docker run \
--rm \
--volume ${PWD}:/workspace \
volkerraschek/build-image:latest \
cargo build --release
```