-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate DockerFile based in Alpine (#77)
* 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
Showing
2 changed files
with
40 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |