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

Change to alpine linux #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
72 changes: 43 additions & 29 deletions pebble-sdk/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
FROM debian:stable
FROM alpine:latest

# update system and get base packages
RUN apt-get update && \
apt-get install -y curl gcc git make python2.7 python2.7-dev python-dev python3-dev python3-pip python python-virtualenv python3-virtualenv libfreetype6-dev bash-completion libsdl1.2debian \
libfdt1 libpixman-1-0 libglib2.0-dev gawk && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apk update && apk add \
bash \
curl \
gcc \
g++ \
git \
make \
python2 \
python2-dev \
python3 \
python3-dev \
musl-dev \
freetype-dev \
bash-completion \
sdl \
libfdt \
pixman \
glib \
gawk \
npm

#manually install latest gcc-arm
RUN curl -sSL https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \
| tar -C /opt/ -xj
RUN apk add \
--no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
gcc-arm-none-eabi

#hacky workaround to make rebbleos makefile happy
RUN ln -s /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/* /usr/bin/

# set the version of the pebble tool
ENV PEBBLE_TOOL_VERSION pebble-sdk-4.5-linux64
Expand All @@ -23,36 +38,35 @@ ENV PEBBLE_SDK_VERSION 4.3
RUN curl -sSL https://developer.rebble.io/s3.amazonaws.com/assets.getpebble.com/pebble-tool/${PEBBLE_TOOL_VERSION}.tar.bz2 \
| tar -C /opt/ -xj


# prepare python environment
RUN /bin/bash -c " \
python -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip install virtualenv"


WORKDIR /opt/${PEBBLE_TOOL_VERSION}
RUN /bin/bash -c " \
virtualenv .env && \
source .env/bin/activate && \
pip install -r requirements.txt && \
deactivate " && \
virtualenv .env && \
source .env/bin/activate && \
pip install -r requirements.txt && \
deactivate " && \
rm -r /root/.cache/

# disable analytics
RUN chmod -R 777 /opt/${PEBBLE_TOOL_VERSION} && \
mkdir -p /home/.pebble-sdk/ && \
touch /home/.pebble-sdk/NO_TRACKING

#install nvm
ENV NODE_VERSION 10.16.2
ENV NVM_DIR /home/.nvm
RUN mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash && \
. $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION
mkdir -p /root/.pebble-sdk/ && \
touch /root/.pebble-sdk/NO_TRACKING

# set PATH
ENV PATH /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/:${NVM_DIR}/versions/node/v${NODE_VERSION}/bin:/opt/${PEBBLE_TOOL_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PATH /opt/${PEBBLE_TOOL_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# check path
RUN /bin/bash -c "arm-none-eabi-gcc -v"
#fix alpine linux encoding
ENV PYTHONIOENCODING=utf-8

# install sdk
RUN yes | pebble sdk install https://github.com/aveao/PebbleArchive/raw/master/SDKCores/sdk-core-${PEBBLE_SDK_VERSION}.tar.bz2 && \
pebble sdk activate ${PEBBLE_SDK_VERSION}

CMD /bin/bash