1

This is my docker-compose.yml file

version: '3'

services:
  age:
    image: apache/age
    container_name: myAge
    ports:
      - "5555:5555"
    volumes:
      - age-data:/var/lib/age
    depends_on:
      - db
    command: ["age-server", "--host", "0.0.0.0", "--port", "5432", "--store", "postgresql://postgresUser:postgresPW@db/postgresDB"]

  db:
    image: postgres
    container_name: myPostgresDb
    restart: always
    environment:
      POSTGRES_USER: postgresUser
      POSTGRES_PASSWORD: postgresPW
      POSTGRES_DB: postgresDB
    volumes:
      - db-data:/var/lib/postgresql/data

volumes:
  age-data:
  db-data:

PostgreSQL is up but apache is give me the following error

myAge         | /usr/local/bin/docker-entrypoint.sh: line 322: exec: age-server: not found
myAge exited with code 127

I am new to docker, but I have tried rewriting the commands but it didn't work Thanks in advance for the help!

3 Answers3

1

From the error message you're receiving, it seems like the Docker image for Apache AGE doesn't recognize age-server as a valid command. The age-server command might be specific to your application or environment, or it could be that the Apache AGE Docker image has been updated.

Explore https://github.com/sorrell/age-compose for better understanding and correct Installment.

0

age-server command is not present in your context.

I removed the "command" field from your docker-compose file and made some changes.

version: '3.8'

services:
  age:
    image: apache/age
    container_name: age
    ports:
      - 5455:5432
    environment:
      POSTGRES_USER: postgresUser
      POSTGRES_PASSWORD: postgresPW
      POSTGRES_DB: postgresDB
    depends_on:
      - db

  db:
    image: postgres
    container_name: db
    restart: always
    environment:
      POSTGRES_USER: postgresUser
      POSTGRES_PASSWORD: postgresPW
      POSTGRES_DB: postgresDB
    volumes:
      - db-data:/var/lib/postgresql/data

volumes:
  db-data:

.

mohayu@mohayudin:~$ sudo docker ps
CONTAINER ID   IMAGE        COMMAND                  CREATED          STATUS          PORTS                                       NAMES
2e65f329cfc5   apache/age   "docker-entrypoint.s…"   1 minutes ago   Up 1 minutes   0.0.0.0:5455->5432/tcp, :::5455->5432/tcp   age
23d9a064a89b   postgres     "docker-entrypoint.s…"   1 minutes ago   Up 1 minutes   5432/tcp    


mohayu@mohayudin:~$ sudo docker exec -it 23d9a064a89b bash
root@23d9a064a89b:
Mohayu Din
  • 433
  • 9
0

Try using age command in-place of age-server write in the command section. Here's the updated code for docker.compose.yml file:

version: '3'

services:
  age:
    image: apache/age
    container_name: myAge
    ports:
      - "5555:5555"
    volumes:
      - age-data:/var/lib/age
    depends_on:
      - db
    command: ["age", "--host", "0.0.0.0", "--port", "5432", "--store", "postgresql://postgresUser:postgresPW@db/postgresDB"]

  db:
    image: postgres
    container_name: myPostgresDb
    restart: always
    environment:
      POSTGRES_USER: postgresUser
      POSTGRES_PASSWORD: postgresPW
      POSTGRES_DB: postgresDB
    volumes:
      - db-data:/var/lib/postgresql/data

volumes:
  age-data:
  db-data:

Hope it will help you.