Docker runs of "pip install" and "npm install" on same container overwriting each other -
in docker container, i'm trying install several packages pip along installing bower via npm. seems whichever of pip or npm run first, other's contents in /usr/local/bin overwritten (specifically, gunicorn missing below dockerfile, or bower missing if swap order of from..run
blocks).
is expected behavior of docker, , if so, how can go installing both pip packages , bower same directory, /usr/local/bin?
here's dockerfile:
from python:3.4.3 run mkdir /code workdir /code add ./requirements/ /code/requirements/ run pip install -r /code/requirements/docker.txt add ./ /code/ node:0.12.7 run npm install bower
here's docker-compose.yml file:
web: restart: build: . expose: - "8000" links: - postgres:postgres #-redis:redis volumes: - .:/code env_file: .env command: /usr/local/bin/gunicorn myapp.wsgi:application -w 2 -b :8000 --reload webstatic: restart: build: . volumes: - /usr/src/app/static env_file: .env command: bash -c "/code/manage.py bower install && /code/manage.py collectstatic --noinput" nginx: restart: #build: ./config/nginx image: nginx ports: - "80:80" volumes: - /www/static - config/nginx/conf.d:/etc/nginx/conf.d volumes_from: - webstatic links: - web:web postgres: restart: image: postgres:latest volumes: - /var/lib/postgresql ports: - "5432:5432"
update: went ahead , cross-posted docker-compose issue since it's unclear if there actual bug or if configuration problem. i'll keep both posts updated, post in either if have idea of going on. thanks!
you cannot use multiple from
commands in dockerfile , cannot create image 2 different base images. if need node , python in same image either add node python image or add python node image.
Comments
Post a Comment