Closed Antoine-O closed 7 years ago
I suspect that those symlinks are outside the filesystem of the container... but what arguments are you running docker with?
nothing special. It happens at the last meteor upgrade :'(
i use a docker compose file
meteor:
build:
context: ./meteor
dockerfile: Dockerfile
environment:
- MONGO_URL=mongodb://xxxx
- ROOT_URL=http://ccccc
- MAIL_URL=smtp://sssss:25
- SETTINGS_FILE=/home/meteor/settings.json
dev_bundle directory seems not to be writable...
each time I restart a new folder "dev_bundle-XXXXXXX" is created
I am programming on Window. It may causes this inconsistency I think
yup the link dev_bundle is bad -> 22/01/2017 13:38
If it was working before the the last meteor upgrade, then chances are that it is related to the permissions model change.
Meteor dropped support for running as root, which, while good practice, makes life a bit more interesting for containers with bind-mounted data directories with unaffiliated and unpredictable permissions.
I suspect that on Windows, the chmod we perform before dropping root privileges has no effect. Unfortunately, I don't have a clue as to how the permissions model maps in a Windows environment. You might try setting global write permissions for that directory as a test.
I find somehow to deal with that (i think) by generating a temporary project to get the right link.
and then :
Error:
EXDEV: cross-device link not permitted, rename '/home/meteor/www/bundle' -
:/
Correct; you cannot make hard links across devices, and you can't use a symlink across the container boundary. I would start with a real, direct copy first... then try to back out and see if you can find some form of bind mounting that works with whatever your Windows filesystem setup is.
ok there I finally succeeded ! But I completely remove whats in the dockerfile to concentrate on "my useful part" : creating an image from src
FYI I compile the meteor application during the creation of the image and the size is acceptable (around 583 MB) and here is the intersting part of the Dockerfile
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git curl && \
(curl https://deb.nodesource.com/setup_4.x | sh) && \
apt-get install -y nodejs jq && \
apt-get install -y build-essential && \
npm install -g semver && \
apt-get clean && \
rm -Rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
setcap 'cap_net_bind_service=+ep' /usr/bin/nodejs && \
cd /home/meteor && \
(curl https://install.meteor.com/ | sh) && \
meteor create test --bare && \
cd /home/meteor/test && \
meteor npm install && \
cp -rf /home/meteor/test/.meteor/local /home/meteor/src/.meteor/local && \
cd /home/meteor/src && \
meteor npm install && \
meteor npm install --save babel-runtime && \
meteor npm install --save xmlhttprequest && \
meteor npm install --save bcrypt && \
meteor npm install --save meteor-node-stubs && \
cd /home/meteor/src && \
mkdir -p /home/meteor/build && \
meteor build --directory /home/meteor/build && \
cd /home/meteor/build/bundle/programs/server && \
npm install && \
npm install --save babel-runtime && \
npm install --save xmlhttprequest && \
npm install --save bcrypt && \
rm -rf /home/meteor/src && \
rm -rf /home/meteor/test && \
rm -rf /usr/local/bin/meteor && \
rm -rf /root/.meteor && \
apt-get remove -y git curl && \
apt-get remove -y build-essential && \
apt-get autoremove -y && \
apt-get clean && \
rm -Rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
it may not be optimized BTW, it is so long to build an image so... I give up as soon as it worked :)
I'm glad you got it working. I would guess the critical difference is that you aren't bind-mounting anything, in your solution. This should have also been achievable by using a URL-sourced build tarball ( the BUNDLE_URL
environment variable) or by pulling the source from a git repository (the REPO
environment variable)
sure, as I am on windows, I am not able to create the right bundle , right ?
I don't think that's a problem, no. Assuming Meteor works at all on Windows, you should be able to create a bundle for it.
To use BUNDLE_URL
:
Step 1: create a bundle of your app from your workstation (no Docker involved)
Step 2: copy that bundle to some HTTP-accessible location
Step 3: run ulexus/meteor
with docker, passing the BUNDLE_URL
environment variable pointing to the HTTP-accessible location
To use REPO
:
Step 1: store your application's source tree to a git repository
Step 2: run ulexus/meteor
with docker, passing the REPO
environment variable pointing to the git repository's HTTP endpoint
Hello ! I am struggling with
FYI files :
any guess ?