feat(rust): add rust compiler
This commit is contained in:
parent
520c35bbfe
commit
f7af2d5785
@ -2,4 +2,4 @@ services:
|
||||
- docker
|
||||
|
||||
script:
|
||||
- make push
|
||||
- make image-push
|
||||
|
@ -5,4 +5,12 @@ RUN pacman --sync \
|
||||
--noconfirm \
|
||||
--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
|
6
Makefile
6
Makefile
@ -1,17 +1,17 @@
|
||||
# VERSION
|
||||
# If no version is specified as a parameter of make, the value latest
|
||||
# is taken.
|
||||
VERSION:=$(or ${TRAVIS_TAG}, ${TRAVIS_TAG}, latest)
|
||||
VERSION:=$(or ${TRAVIS_TAG}, latest)
|
||||
|
||||
# DOCKER_USER
|
||||
DOCKER_USER:=volkerraschek
|
||||
|
||||
build:
|
||||
image-build:
|
||||
docker build \
|
||||
--no-cache \
|
||||
--tag ${DOCKER_USER}/build-image:${VERSION} \
|
||||
.
|
||||
|
||||
push: build
|
||||
image-push: image-build
|
||||
docker login --username ${DOCKER_USER} --password ${DOCKER_PASSWORD}
|
||||
docker push ${DOCKER_USER}/build-image:${VERSION}
|
20
README.md
20
README.md
@ -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)
|
||||
|
||||
This project contains only files to build a build container image.
|
||||
|
||||
## 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
|
||||
$ docker run \
|
||||
--rm \
|
||||
--volume ${PWD}:/workspace \
|
||||
volkerraschek/build-image:latest \
|
||||
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
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user