Minimalist docker-compose file
I have a number of directories each with a Dockerfile. I am able to build each one independently. I want to be able to use docker-compose to bring them up. The only thing I need to specify in the compose is the links and volumes. Any snippets of a simple compose example I can use? All the examples I'm seeing are referring to the images etc and those are already specified in the individual Dockerfiles. Will be nice to see a few examples.
See also questions close to this topic
Run docker inside docker to avoid installing multiple dependencies
I'm in front of one dilemma that I'd like to discuss here to open a constructive discussion.
My use case is very simple:
I need to run a bash script which execute several commands like install
aws-cliand query PostgreSQL. For this last task I use
psql. Easy task I'd say however Docker slightly complicate the situation.
The problem would be solved if I would create an image where I'd install all the dependencies. However the result would be a pretty big image and I'd not go with this solution.
What about to run the script with one Docker image and then from the script (inside Docker) run something like
docker run postgres:9.6.3-alpine psql
docker run node:9.8 npm
In other words would be to run docker inside docker. What do you think?
Dot and colon meaning
What does dot-colon
mean in situation like this:
version: '3' services: php: image: php:7.1-fpm ports: - 9000 volumes: - .:/var/www/project:cached
Is this part of bash syntax or is it part of Docker syntax (haven't found any info on both).
Angular app + NGINX + Docker
I have problem with serving Angular app using nginx on docker. Problem is only when I want to turn on SSL on site. I'm using Bamboo for deployment.
Here is my Dockerfile:
FROM node:8.6 as node WORKDIR /app COPY package.json /app/ COPY ssl/certificate.crt /app/ COPY ssl/ /app/ssl RUN npm install -g @angular/cli --unsafe RUN npm install COPY ./ /app/ RUN ng build --prod --aot=false --env=prod FROM nginx RUN mkdir -p /ssl COPY --from=node /app/ssl/ /ssl/ ADD ssl/certificate.crt /etc/nginx/certs/ ADD ssl/private.key /etc/nginx/certs/ RUN ls /etc/nginx/certs/ COPY --from=node /app/dist/ /usr/share/nginx/html RUN ls /usr/share/nginx/html
Script to run:
docker build -t test-app . docker run --name test-app-cont -v /etc/nginx/certs:/etc/nginx/certs -d -p 3010:443 test-app
Deployment runs successfully, but there is no app on server served.
Please have a look at this screen: There is listed what is in /certs and /html directories. Everything seems to be good.
If I remove these lines dedicated to SSL, everything works fine, and on server I can see my app, but only through http.
The certificates are valid, I checked.
What am I doing wrong?
airflow: broken DAG <dag_path> No module named <module_name>
I'm running airflow in a docker container as described here. My first DAG that I've created shows in the webserver a broken DAG because of dependencies that were not found. I've installed my dependencies through the Dockerfile:
FROM python:3.6-slim COPY requirements.txt /opt/app/requirements.txt WORKDIR /opt/app RUN pip install -r requirements.txt --user COPY . /opt/app
As a workaround I've tried to run
pip install --upgrade <module_name> --userfrom inside the container. If I enter python inside the container and import it works but Airflow seems to ignore it.
Do you have any ideas how I can fix it?
Hyperledger Fabric on Ubuntu Linux 16.04 VM not running
I have setup a Hyperledger server in an Ubuntu VM instance. On the Ubuntu VM, I tried running Hyperledger Fabric-peer using the docker-compose.yml file with the following configuration:
membersrvc: image: hyperledger/fabric-membersrvc ports: - "7054:7054" command: membersrvc vp0: image: hyperledger/fabric-peer ports: - "7050:7050" - "7051:7051" - "7053:7053" environment: - CORE_PEER_ADDRESSAUTODETECT=true - CORE_VM_ENDPOINT=unix:///var/run/docker.sock - CORE_LOGGING_LEVEL=DEBUG - CORE_PEER_ID=vp0 - CORE_PEER_PKI_ECA_PADDR=membersrvc:7054 - CORE_PEER_PKI_TCA_PADDR=membersrvc:7054 - CORE_PEER_PKI_TLSCA_PADDR=membersrvc:7054 - CORE_SECURITY_ENABLED=true - CORE_SECURITY_ENROLLID=test_vp0 - CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT links: - membersrvc command: sh -c "sleep 10; peer node start"
this has the same configuration suggested in this page: https://github.com/hyperledger-archives/fabric/blob/master/pub/fabric-peer.md but I encountered a problem shown in this screenshot:
From what I have understand, hyperledger/fabric-peer is needed to be able to do transactions on the blockchain from deploying chaincodes to performing operations on the ledger. May I know what I am doing wrong from using the above docker-compose.yml with docker-compose up command and if my understanding is correct? Are there any components that might be causing the problem with running the Hyperledger docker image?
Basically, I need to be able to deploy a chaincode and invoke the methods in the chaincode from an Ubuntu server running Hyperledger Fabric.