Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile #67

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Docker

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

env:
IMAGE_NAME: qorc-sdk

jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v2

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin

- name: Build image
run: docker build --build-arg PARENT_IMAGE=docker.pkg.github.com/quicklogic-corp/quicklogic-fpga-toolchain/symbiflow-ql:1.3.0 ./dockerfiles --file ./dockerfiles/Dockerfile --tag $IMAGE_NAME

- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')

# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')

# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest

echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION

docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
42 changes: 42 additions & 0 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ARG PARENT_IMAGE="docker.pkg.github.com/quicklogic-corp/quicklogic-fpga-toolchain/symbiflow-ql:1.3.0"
FROM ${PARENT_IMAGE}

WORKDIR /opt

RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \
tar -xjvf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 && \
rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2

ENV PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux:$PATH

# Below are some example commands to build and run a docker container.
# From within the dockerfiles directory in a terminal window type:
#
# docker build . -t qorc-sdk
#
# In a directory containing a qorc-sdk project:
# docker run -it --rm -v $(pwd):/root qorc-sdk bash
#
# The above will execute bash within the running container. Any
# tools called thru bash will run within the container.
#
# Test the container in the /root/qf_apps directory
#
# source ${INSTALL_DIR}/conda/etc/profile.d/conda.sh
# conda activate
#
# cd /root/qf_apps
# make
#
# When you are finished, you may want to clean the qf_apps directory
# because this container runs as root, which means files are created
# as the root user, and they are difficult to remove as an ordinary user.
#
# make clean
# exit
#
# This container image intentionally does not add a user or entrypoint.
# This allows easy use of this container as a parent image for adapting
# it to specific needs. An example with a prebuilt ready-to-run Docker
# container package built through a github actions workflow is here:
# https://github.com/Thirsty2/qorc-sdk-user