docker-compose

(Docker) How to install dependencies, using separate Composer container, in WordPress container?

这一生的挚爱 提交于 2021-02-06 13:57:13
问题 Dockerfile FROM wordpress ENV REFRESHED_AT 2015-08-12 ADD \ composer.json /var/www/html ADD \ composer.lock /var/www/html # install the PHP extensions RUN \ apt-get -qq update && \ apt-get -y upgrade && \ apt-get install -y vim wget && \ rm -rf /var/lib/apt/lists/* # Symlink User's "wp-content" folder into the newly installed Wordpress RUN \ rm -rf /usr/src/wordpress/wp-content/plugins/* && \ rm -rf /usr/src/wordpress/wp-content/themes/* && \ cp -fr /usr/src/wordpress/* /var/www/html/ && \

What is happening when using ../ with docker-compose volume

时光怂恿深爱的人放手 提交于 2021-02-06 10:40:30
问题 I am having problems with writing files out from inside a docker container to my host computer. I believe this is a privilege issue and prefer not to set privileged: True . A work around for writing out files is by pre-pending ../ to a volume in my docker-compose.yml file. For example, version: '3' services: example: volumes: - ../:/example What exactly is ../ doing here? Is it taking from the container's privileges and "going up" a directory to the host machine? Without ../ , I am unable to

Use multi-stage docker files for outputting multiple images

时光怂恿深爱的人放手 提交于 2021-02-06 10:13:02
问题 A new docker feature is to do something like this in the dockerfile FROM php7-fpm as build ... FROM build AS test ... FROM test AS staging ... As far as i know, the last FROM statement marks the final output image. How is it possible to have two final images from one intermdiate image? Like ... FROM build AS test ... FROM test AS staging ... FROM test AS prod Test, staging and prod should not be discarded. I want to check in them into the repository. 回答1: You can stop the build at a certain

Use multi-stage docker files for outputting multiple images

纵饮孤独 提交于 2021-02-06 10:12:37
问题 A new docker feature is to do something like this in the dockerfile FROM php7-fpm as build ... FROM build AS test ... FROM test AS staging ... As far as i know, the last FROM statement marks the final output image. How is it possible to have two final images from one intermdiate image? Like ... FROM build AS test ... FROM test AS staging ... FROM test AS prod Test, staging and prod should not be discarded. I want to check in them into the repository. 回答1: You can stop the build at a certain

SSH agent forwarding during docker build

爱⌒轻易说出口 提交于 2021-02-06 09:51:35
问题 While building up a docker image through dockerfile, I have to clone a github repo. I have added my public ssh keys to my git hub account and i am able to clone the repo from my docker host. While i see that i can use docker host's ssh key by mapping $SSH_AUTH_SOCK env variable at the time of docker run like docker run --rm -it --name container_name \ -v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) \ -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK my_image . How can i do same during docker build ? 回答1

SSH Agent forwarding inside docker compose container

99封情书 提交于 2021-02-06 09:12:27
问题 Could not open a connection to your authentication agent. I am following the approach of mounting the $SSH_AUTH_SOCK as a volume, but doing so with compose. Setup ~/.ssh/config Host * ForwardAgent yes Dockerfile: FROM atlashealth/ruby:2.2.2 RUN apt-get update -qq && \ apt-get install -qy build-essential libxml2-dev libxslt1-dev \ g++ qt5-default libqt5webkit5-dev xvfb dbus \ libmysqlclient-dev \ mysql-client openssh-client git && \ # cleanup apt-get clean && \ cd /var/lib/apt/lists && rm -fr

SSH Agent forwarding inside docker compose container

六月ゝ 毕业季﹏ 提交于 2021-02-06 09:04:42
问题 Could not open a connection to your authentication agent. I am following the approach of mounting the $SSH_AUTH_SOCK as a volume, but doing so with compose. Setup ~/.ssh/config Host * ForwardAgent yes Dockerfile: FROM atlashealth/ruby:2.2.2 RUN apt-get update -qq && \ apt-get install -qy build-essential libxml2-dev libxslt1-dev \ g++ qt5-default libqt5webkit5-dev xvfb dbus \ libmysqlclient-dev \ mysql-client openssh-client git && \ # cleanup apt-get clean && \ cd /var/lib/apt/lists && rm -fr

Can't run rake db:create in Dockerfile with docker-compose

为君一笑 提交于 2021-02-06 08:24:58
问题 I have a Dockerfile and docker-compose.yml like in the tutorial except I'm starting with an existing app. My docker-compose.yml looks like: db: image: postgres ports: - "5432" web: build: . command: bundle exec rails s -p 3000 -b '0.0.0.0' volumes: - .:/myapp ports: - "3030:3030" links: - db and Dockerfile : FROM ruby:2.1.4 RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /myapp WORKDIR /myapp ADD Gemfile /myapp/Gemfile RUN bundle install ADD . /myapp #

How to run docker-compose on remote host?

余生长醉 提交于 2021-02-05 14:50:54
问题 I have compose file locally. How to run bundle of containers on remote host like docker-compose up -d with DOCKER_HOST=<some ip> ? 回答1: If you don't need to run docker container on your local machine, but still on the same remote machine, you can change this in your docker setting. On the local machine: You can control remote host with -H parameter docker -H tcp://remote:2375 pull ubuntu To use it with docker-compose, you should add this parameter in /etc/default/docker On the remote machine

How to run docker-compose on remote host?

时间秒杀一切 提交于 2021-02-05 14:50:28
问题 I have compose file locally. How to run bundle of containers on remote host like docker-compose up -d with DOCKER_HOST=<some ip> ? 回答1: If you don't need to run docker container on your local machine, but still on the same remote machine, you can change this in your docker setting. On the local machine: You can control remote host with -H parameter docker -H tcp://remote:2375 pull ubuntu To use it with docker-compose, you should add this parameter in /etc/default/docker On the remote machine