Skip to content

Commit

Permalink
Generate DockerFile based in Alpine (#77)
Browse files Browse the repository at this point in the history
* Create docker yml file

* Delete docker.yml

* Create docker.yml

* Use alpine as docker file

* Add pkgconfig to dependencies in dockerfile

* Update folder to copy

* Try to migrate to v2 the upload of docker

* Fix wrong secrets name

* Update docker.yml

* Update docker.yml

* Put dynamic the number of cores

* Rename docker tag

Co-authored-by: Francisco Javier Trujillo Mata <[email protected]>
  • Loading branch information
fjtrujy and Francisco Javier Trujillo Mata authored Sep 11, 2020
1 parent 0c5b4ae commit 53c9a64
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI-Docker

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- uses: docker/build-push-action@v2
with:
push: true
tags: vitasdk/buildscripts:latest
35 changes: 10 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
FROM ubuntu:trusty
MAINTAINER [email protected]
# First stage of Dockerfile
FROM alpine:latest

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y cmake git build-essential autoconf texinfo && \
rm -rf /var/lib/apt/lists/*
COPY . /src

ENV OUTPUT_DIR=/out
RUN apk add build-base cmake git bash autoconf texinfo patch pkgconfig
RUN cd /src && mkdir build && cd build && cmake .. && make -j$(nproc)

RUN adduser --disabled-login --gecos 'user' user && passwd -d user
# Second stage of Dockerfile
FROM alpine:latest

USER user
WORKDIR /home/user
ENV VITASDK /home/user/vitasdk
ENV PATH ${VITASDK}/bin:$PATH

RUN mkdir /home/user/.ssh && chmod 700 /home/user/.ssh -R && \
ssh-keyscan github.com >> /home/user/.ssh/known_hosts

RUN git clone https://github.com/codestation/vitasdk-cmake

RUN mkdir build
WORKDIR /home/user/build
RUN cmake /home/user/vitasdk-cmake
RUN make -j4
RUN mv vitasdk /home/user

WORKDIR /home/user
RUN echo VITASDK=/home/user/vitasdk >> /home/user/.bashrc
RUN echo PATH=\$VITASDK/bin:\$PATH >> /home/user/.bashrc

RUN rm -rf /home/user/build /home/user/vitasdk-cmake
COPY --from=0 /src/build/vitasdk ${VITASDK}

0 comments on commit 53c9a64

Please sign in to comment.