diff --git a/.travis.yml b/.travis.yml index e3382f9..f9ebbfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,4 @@ services: - docker script: - - make push + - make image-push diff --git a/Dockerfile b/Dockerfile index b77a3da..85bcce0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/Makefile b/Makefile index 27d654c..8b304c2 100644 --- a/Makefile +++ b/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} \ No newline at end of file diff --git a/README.md b/README.md index 0eeec86..68eb4dd 100644 --- a/README.md +++ b/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 -``` \ No newline at end of file +``` + +## 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 +```