2

I want to install vim in my docker container, but there is some problem so I can't install vim...My docker container OS is as follows.

Oracle Linux Server release 8.6
NAME="Oracle Linux Server"
VERSION="8.6"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.6"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:6:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.6
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.6
Red Hat Enterprise Linux release 8.6 (Ootpa)
Oracle Linux Server release 8.6

And my docker-compose.yml is this.

version: "3"
services:
  mysql:
    image: mysql:latest
    container_name: mysql
    ports:
      - "3306:3306"
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: ""
      TZ: "Asia/Seoul"
    command:
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
    volumes:
      - /home/ubuntu/docker/data/mysql:/var/lib/mysql

but I can't use dnf, yum, apt-get. How can I install vim here..? can't use

geniemo
  • 21
  • 3
  • This is my first question at stackoverflow, so sorry for mistake about attaching image.. – geniemo Jul 22 '22 at 17:02
  • Please [edit] the question to replace the images with the actual text of your files. Including your image's Dockerfile (as code-formatted plain text directly in the question) would also be helpful. – David Maze Jul 22 '22 at 17:16
  • ...why do you need to install a text editor inside a database? Is it an Alpine-based image that uses `apk`? – David Maze Jul 22 '22 at 17:44
  • @DavidMaze I need to set max_allowed_packet at /etc/my.cnf – geniemo Jul 22 '22 at 18:09
  • You can pass that argument as a command-line option; see for example [increase max_allowed_packet size in mysql docker](https://stackoverflow.com/questions/39369367/increase-max-allowed-packet-size-in-mysql-docker). – David Maze Jul 22 '22 at 18:18

1 Answers1

1

apt-get, yum, dnf is not installed in the mysql:latest image. You should use the microdnf like below:

microdnf install -y vim
Key Shang
  • 837
  • 15
  • 21