The command in docker-compose.yml is not executed

FROM openjdk:14-jdk-alpine
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

it is a Dockerfile.

version: '3.9'

services:
  server:
    image: server
    command: /bin/sh -c "mkdir test2"
    ports:
      - "8081:8080"
    volumes:
      - ./ext:/ext

It’s a docker-compose.yml
The command in docker-compose.yml that is bin/sh -c "mkdir test2" is not executed…
What should I do? I can’t know what should I do… help me! (편집됨)

When a container is started, it does execute whatever is declared as entrypoint and uses the command as argument. In the absence of entrypoint, it will only execute the command.

Thus said, your container actualy executes: java -jar /app.jar /bin/sh -c "mdkir test2"

My I suggest a fabulous free self-paced docker training?
https://container.training/intro-selfpaced.yml.html