Skip to content

Commit

Permalink
add runtime stripped target
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Feb 28, 2024
1 parent 61f053a commit e917165
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
max-parallel: 1 # take advantage of caching
matrix:
target: [developer]
target: [developer, runtime]
architecture: [linux]
include:
- os: ubuntu-latest
Expand Down
40 changes: 28 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
FROM ubuntu:22.04 as developer
FROM ubuntu:22.04 as environment

ENV VIRTUALENV /venv
ENV RTEMS_MAJOR=6
ENV RTEMS_MINOR=1-rc2
ENV RTEMS_VERSION=${RTEMS_MAJOR}.${RTEMS_MINOR}
ENV RTEMS_ARCH=powerpc
ENV RTEMS_BSP=beatnik
ENV RTEMS_BASE=/rtems${RTEMS_VERSION}-${RTEMS_BSP}-legacy
ENV RTEMS_ROOT=${RTEMS_BASE}/rtems/${RTEMS_VERSION}
ENV PATH=${RTEMS_ROOT}/bin:${PATH}
ENV LANG=en_GB.UTF-8

FROM environment AS developer

# build tools for x86 including python and busybox (for unzip and others)
# https://docs.rtems.org/branches/master/user/start/preparation.html#host-computer
Expand All @@ -16,17 +29,6 @@ RUN apt-get update -y && apt-get upgrade -y && \
&& rm -rf /var/lib/apt/lists/* && \
busybox --install

ENV VIRTUALENV /venv
ENV RTEMS_MAJOR=6
ENV RTEMS_MINOR=1-rc2
ENV RTEMS_VERSION=${RTEMS_MAJOR}.${RTEMS_MINOR}
ENV RTEMS_ARCH=powerpc
ENV RTEMS_BSP=beatnik
ENV RTEMS_BASE=/rtems${RTEMS_VERSION}-${RTEMS_BSP}-legacy
ENV RTEMS_ROOT=${RTEMS_BASE}/rtems/${RTEMS_VERSION}
ENV PATH=${RTEMS_ROOT}/bin:${PATH}
ENV LANG=en_GB.UTF-8

# setup a python venv - requried by the RSB to find 'python'
RUN python3 -m venv ${VIRTUALENV}
ENV PATH=${VIRTUALENV}/bin:${PATH}
Expand Down Expand Up @@ -73,5 +75,19 @@ RUN git submodule init && \
./waf && \
./waf install

from environment AS runtime-prep

# to make this container much smaller we take just the BSP and strip it
# At present epics-base will not build in github with the developer version
# because of the 7GB limit on the size GHA filesystem. Therefore this 'runtime'
# container is used there.

COPY from=developer ${RTEMS_ROOT} ${RTEMS_ROOT}

RUN powerpc-rtems6-strip $(find ${RTEMS_ROOT}) 2>/dev/null
RUN strip $(find ${RTEMS_ROOT}) 2>/dev/null

from environment AS runtime

COPY from=developer ${RTEMS_ROOT} ${RTEMS_ROOT}

0 comments on commit e917165

Please sign in to comment.