Home > Blockchain >  Use git in a docker binami image that runs in docker swarm
Use git in a docker binami image that runs in docker swarm

Time:02-16

I am running a standard magento image using portainer.io, the problem is that the standard image doesn't have git installed by default, i attempted to add the binami git image to the docker-compose.yml, the stack run successfully but i cannot access git in the command line

docker-compose.yml :

version: '3'
services:
  git:
    image: docker.io/bitnami/git:2
    deploy:
      restart_policy:
        condition: none
  mariadb:
    image: docker.io/bitnami/mariadb:10.3
    environment:
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_USER=bn_magento
      - MARIADB_DATABASE=bitnami_magento
    volumes:
      - 'mariadb_data:/bitnami/mariadb'
  magento:
    image: docker.io/bitnami/magento:2
    ports:
      - '80:8080'
      - '443:8443'
    environment:
      - MAGENTO_HOST=localhost
      - MAGENTO_DATABASE_HOST=mariadb
      - MAGENTO_DATABASE_PORT_NUMBER=3306
      - MAGENTO_DATABASE_USER=bn_magento
      - MAGENTO_DATABASE_NAME=bitnami_magento
      - ELASTICSEARCH_HOST=elasticsearch
      - ELASTICSEARCH_PORT_NUMBER=9200
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      - 'magento_data:/bitnami/magento'
      - 'magento_certs:/certs'
    depends_on:
      - mariadb
      - elasticsearch
      - git
  elasticsearch:
    image: docker.io/bitnami/elasticsearch:7
    volumes:
      - 'elasticsearch_data:/bitnami/elasticsearch/data'
volumes:
  mariadb_data:
    driver: local
  magento_data:
    driver: local
  elasticsearch_data:
    driver: local
  magento_certs:
    driver: local

CodePudding user response:

Having the Dockerfile:

FROM bitnami/magento:2

RUN apt-get update && apt-get install git -y
$ docker build -t magento-git .

And use magento-git in place of bitnami/magento

  • Related