Skip to content

Commit

Permalink
docker: migrate from python:3.10 to ubuntu:22.04 image. (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
bieganski authored Sep 27, 2023
1 parent 25dcd60 commit 9436a4c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
25 changes: 16 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
FROM python:3.10
FROM ubuntu:22.04

LABEL version='{{ version }}'
LABEL org.opencontainers.image.description='{{ readme }}'
LABEL org.opencontainers.image.vendor='{{ author }}'

SHELL ["/bin/bash", "-c"]
WORKDIR /toolchain

# Normal update
RUN apt-get update -y

# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_16.x | sed --expression='s/sleep 60//g' | bash -
RUN apt-get -y install nodejs npm
RUN apt-get -y install curl git pip

# Install proper nodejs version.
ENV NVM_DIR=/toolchain
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh > install.sh
RUN echo "69da4f89f430cd5d6e591c2ccfa2e9e3ad55564ba60f651f00da85e04010c640 install.sh" > checksum.txt
RUN sha256sum -c checksum.txt
RUN bash ./install.sh
RUN source "$NVM_DIR/nvm.sh" && nvm install v16.20.0 && nvm use v16.20.0

# Install XPM
RUN npm install --global xpm@latest
RUN source "$NVM_DIR/nvm.sh" && npm install --global xpm@0.16.4

# Install gcc extensions
RUN xpm install --global @xpack-dev-tools/riscv-none-elf-gcc@latest --verbose
# Install gcc toolchain
RUN source "$NVM_DIR/nvm.sh" && xpm install --global @xpack-dev-tools/riscv-none-elf-gcc@13.2.0-1.2 --verbose
ENV PATH="/root/.local/xPacks/@xpack-dev-tools/riscv-none-elf-gcc/13.2.0-1.2/.content/bin:$PATH"

# Install Poetry

RUN pip3 install --upgrade pip
RUN pip3 install poetry

# Install Poetry dependencies
ADD pyproject.toml .
ADD poetry.lock .

RUN poetry install --no-interaction

ADD mtkcpu ./mtkcpu
RUN poetry install --no-interaction

ENV PATH=$HOME/.poetry/bin/:$PATH
ENTRYPOINT ["poetry", "run", "mtkcpu"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ build-docker:
bash ./build_docker_image.sh

test-docker:
docker run docker.io/library/mtkcpu:1.0.0 tests cpu
docker run docker.io/library/mtkcpu:1.0.0 poetry run mtkcpu tests cpu

test:
poetry run pytest -n 12
Expand Down

0 comments on commit 9436a4c

Please sign in to comment.