theia-ide / theia-apps

Theia applications examples - docker images, desktop apps, packagings
Apache License 2.0
1.04k stars 345 forks source link

Docker build issue #449

Closed garybowers closed 3 years ago

garybowers commented 3 years ago

I think I may be going mad but my docker fails to build (no changes) with the following issue:

[4/4] Building fresh packages...
error /home/theia/node_modules/publish-please: Command failed.
Exit code: 130
Command: node lib/post-install.js
Arguments: 
Directory: /home/theia/node_modules/publish-please
Output:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! publish-please hooks were successfully setup for the project. !!
!! Now follow few simple steps to configure your publishing...   !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

-- Configuring option "prePublishScript":
? Do you want to run any scripts before publishing (e.g. build steps, tests)? (Y
/n) 
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Context: I'm just running yarn theia build in the container, using package.json and Dockerfile from the docker-full example for sanity check, I don't want to publish anything to anywhere, I just want theia to run in the container.

I'm stuck at the moment.

vince-fugnitto commented 3 years ago

@garybowers do you mind providing additional details, for example your project (dockerfile, package.json) and which commands you are using?

If you are attempting to build an image such as theia-full-docker, the command we use is:

docker build --no-cache . -t theiaide/theia-full:latest

When at the same level as the dockerfile.

garybowers commented 3 years ago

It was driving me mad, but it's started working this morning with no changes after me giving up for a while. I did need to increase the max_old_space_size from 4096 to 8192 however

Here's my dockerfile:

ARG DEBIAN_VERSION=buster-slim
FROM debian:${DEBIAN_VERSION}

ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHON=/usr/bin/python3

RUN apt-get update && \
    apt-get -y install --no-install-recommends ca-certificates curl xz-utils wget gpg build-essential apt-transport-https apt-utils sudo git gnupg-agent software-properties-common dirmngr libpng-dev && \
    rm -rf /var/cache/apt/* && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/* && \
    mkdir -p /usr/share/man/man1/ && \
    mkdir -p /usr/local/theia

# Install Python 3
RUN apt-get update && \
    apt-get install -y python3-dev python3-pip python3-setuptools && \
    rm -rf /var/cache/apt/* && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/* && \
    python3 -m pip install --upgrade pip --user && \
    python3 -m pip install --upgrade pylint python-language-server flake8 autopep8;

RUN set -ex && \
    for key in \
    4ED778F539E3634C779C87C6D7062848A1AB005C \
    B9E2F5981AA6E0CD28160D9FF13993A75599653C \
    94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
    B9AE9905FFD7803F25714661B63B535A4C206CA9 \
    77984A986EBC2AA786BC0F66B01FBB92821C587A \
    71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
    FD3A5288F042B6850C66B31F09FE44734EB7990E \
    8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
    C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
    DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
    A48C2BEE680E841632CD4E44F07496B3EB3C1762 \
    ; do \
    gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
    gpg --batch --keyserver pool.sks-keyservers.net --recv-keys "$key" || \
    gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
    gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
    gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
    done

# Install Node
ARG NODE_VER=12.18.3
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
    case "${dpkgArch##*-}" in \
    amd64) ARCH='x64';; \
    ppc64el) ARCH='ppc64le';; \
    s390x) ARCH='s390x';; \
    arm64) ARCH='arm64';; \
    armhf) ARCH='armv7l';; \
    i386) ARCH='x86';; \
    *) echo "unsupported architecture"; exit 1 ;; \
    esac && \
    curl -SLO "https://nodejs.org/dist/v$NODE_VER/node-v$NODE_VER-linux-$ARCH.tar.xz" && \
    curl -SLO --compressed "https://nodejs.org/dist/v$NODE_VER/SHASUMS256.txt.asc" && \
    gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc && \
    grep " node-v$NODE_VER-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - && \
    tar -xJf "node-v$NODE_VER-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner && \
    rm "node-v$NODE_VER-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt && \
    ln -s /usr/local/bin/node /usr/local/bin/nodejs 

# Install yarn
ARG YARN_VER=1.22.5
RUN set -ex \
    && for key in \
    6A010C5166006599AA17F08146C2130DFD2497F5 \
    ; do \
    gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
    gpg --batch --keyserver pool.sks-keyservers.net --recv-keys "$key" || \
    gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
    gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
    gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
    done && \
    curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VER/yarn-v$YARN_VER.tar.gz" && \
    curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VER/yarn-v$YARN_VER.tar.gz.asc" && \
    gpg --batch --verify yarn-v$YARN_VER.tar.gz.asc yarn-v$YARN_VER.tar.gz && \
    mkdir -p /opt/yarn && \
    tar -xzf yarn-v$YARN_VER.tar.gz -C /opt/yarn --strip-components=1 && \
    ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn && \
    ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg && \
    rm yarn-v$YARN_VER.tar.gz.asc yarn-v$YARN_VER.tar.gz

WORKDIR /usr/local/theia

ARG version=latest
ADD files/package.json ./package.json
RUN apt-get update -y && apt-get install -y node-typescript && \
    yarn --cache-folder ./ycache && rm -rf ./ycache && \
    NODE_OPTIONS="--max_old_space_size=8192" yarn theia build ; \
    yarn theia download:plugins && \
    chmod +x ./plugins/yangster/extension/server/bin/yang-language-server

ENV SHELL=/bin/bash \
    THEIA_DEFAULT_PLUGINS=local-dir:/usr/local/theia/plugins

RUN mkdir -p /etc/skel/.theia /etc/skel/workspace /etc/skel/.ssh /workspace/.cache && \
    chown -R 1001:1001 /workspace && \
    adduser --gecos '' --uid 1001 --shell /bin/bash --disabled-password coder && \ 
    cp /etc/sudoers /etc/sudoers.dist && \
    echo "%coder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

EXPOSE 3000

package.json.txt

vince-fugnitto commented 3 years ago

...but it's started working this morning

Closing since I believe the issue is working based on the last update. If the problem persists please don't hesitate in re-opening the issue.