A
A
Adel Khalitov2019-09-14 17:53:33
Docker
Adel Khalitov, 2019-09-14 17:53:33

How to compile inside OC?

Conditionally, I need to: Build a centos image and install some packages in it, the option with one Dockerfile is not suitable.
I read a bunch of articles on how easy it is to build an image, but without specifically specifying the OS. I do not like it.
Here is an elementary example from some site:

version: '3.3'

services:
  db:
    image: mysql:5.7
    restart: always
    volumes:
      - db_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: wordpress

  wordpress:
    image: wordpress
    restart: always
    volumes:
      - ./wp_data:/var/www/html
    ports:
      - "8080:80"
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_PASSWORD: password
    depends_on:
       - db

volumes:
    db_data:
    wp_data:

Conditionally creating docker-compose.yml, I list the dependencies that I need to create in the image, but do not specify which OS I need to do this on.
So what's the right way to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2019-09-14
@Sanes

By default, there seems to be an image of Alpine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question