-
Notifications
You must be signed in to change notification settings - Fork 58
Cannot start or build reason app inside node:9-alpine container #62
Comments
Does this work with the stock |
Hi @portenez, thanks for filing this issue! Could you please paste the full output of the error logs? I don't know if any of the maintainers here use Docker, and installing it to debug this issue would be a serious time commitment from us. Additionally, pasting the error logs could give us a lot for information and we can tell if it's a known issue from Reason, or from the upstream create-react-app. I also recommend searching the create-react-app repo for more information on using it with Docker. Thanks again! |
Create react app does work. I have another project with a similar setup (create react app) , but no reasonml. that one work just fine. I'll double check versions and post a dockerfile for that one (just create react app) as soon as I have a chance. How do I enable the debug logs? I'll post them here. |
You said the “start” command fails? What do yoya mean by fails? This is a difficult and time consuming set up to replicate, so we would appreciate knowing how it fails, there may be a different error than just running it in docket. |
Create React App versionsworking = YES Version 1 with npxFROM node:9-alpine
RUN addgroup -S app && adduser -S -G app app
USER app
RUN mkdir ~/.npm-global
RUN npm config set prefix '~/.npm-global'
ENV PATH=~/.npm-global/bin:$PATH
RUN cd ~ \
&& npx create-react-app my-app
WORKDIR /home/app/my-app Version 2 with yarnFROM node:9-alpine
RUN addgroup -S app && adduser -S -G app app
USER app
RUN mkdir ~/.npm-global
RUN npm config set prefix '~/.npm-global'
ENV PATH=~/.npm-global/bin:$PATH
RUN cd ~ \
&& yarn create react-app my-app
WORKDIR /home/app/my-app To run
Sample succesful output:
|
@rrdelaney I updated the original ticket with the output that I'm getting. More than docker, looks like a Linux issue. To replicate any of the scenarios pretty much these are the steps:
So for example mkdir dockerTest
cd dockerTest
touch Dockerfile
vim Dockerfile #here paste the contents
docker build . -t test-container
docker run --rm -it test-container yarn start # the last tokens in the cli are passed to the container
#or
docker run --rm -it test-container yarn build An alternative way to reproduce it is to just open a terminal in node:9-alpine and type all the commands in there. More difficult IMO. You could start such terminal by:
Which will give you a completely clean node:9-alpine container |
It looks like Alpine Linux doesn’t have the script command. reason-scripts running on Linux system requires that command to be present. Please see rrdelaney/bs-loader#35 and gliderlabs/docker-alpine#160 for more information. |
I see, that's a shame. I guess I'm going to try using debían instead. Thanks for the help. Perhaps, it'd be useful to have some Linux info in the docs. Or maybe I missed it? |
As reference, FROM ubuntu:xenial
RUN apt-get update \
&& apt-get install -y curl \
build-essential \
git \
&& apt-get clean \
&& apt-get autoremove --purge
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - \
&& apt-get install -y nodejs \
&& apt-get clean
RUN npm install -g yarn
RUN yarn add global reason-cli@3.2.0-linux
RUN yarn add global bs-platform
RUN mkdir -p /opt \
&& yarn create react-app my-app --scripts-version reason-scripts \
&& cd my-app
WORKDIR /opt/my-app
CMD ["yarn", "start"] build contianer |
@portenez I just ran into this myself and |
yarn start
andyarn build
both fail inside a docker container built using the instructions in the docs. Running inside alpine is a must for compiling inside a CI pipeline.To reproduce:
Dockerfile
. e.g.:docker build . -t sad-reson
yarn start
fails. try by:docker run --rm -it sad-reason yarn start
yarn build
fails. try by:docker run --rm -it sad-reason yarn build
Sample error:
The text was updated successfully, but these errors were encountered: