Enter the container command:
docker exec -it google-authenticator bash
Error report details:
OCI runtime exec failed: exec failed: unable to start container process: exec: "bash": executable file not found in $PATH: unknown
Solution:
Add in Dockerfile:
RUN apk add --no-cache bash
Delete the original image, rebuild and start it
Example:
Dockerfile file content
FROM openjdk:8-jdk-alpine
RUN apk add --update --no-cache ttf-dejavu fontconfig && rm -rf /var/cache/apk/*
RUN apk add --no-cache bash
COPY google-authenticator-demo-0.0.1-SNAPSHOT.jar /app.jar
ENV JAVA_OPTS="-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"
ENTRYPOINT ["/bin/bash", "-c", "java -Duser.timezone=GMT+08 -jar /app.jar"]
Build the image:
docker build -t google-authenticator .
run:
docker run -itd --name google-authenticator -p 8111:8111 google-authenticator
Enter the container normally
[root@hecs-399223 docker_service]# docker exec -it google-authenticator bash
bash-4.4#