FROM abc/openjdk:11.0.1 RUN adduser --disabled-password --home /home/app app&& mkdir /home/app/logs && chown app:app /home/app/logs USER user WORKDIR /home/app ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom"]
Em cảm ơn.
We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
FROM abc/openjdk:11.0.1 RUN adduser --disabled-password --home /home/app app&& mkdir /home/app/logs && chown app:app /home/app/logs USER user WORKDIR /home/app ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom"]
Em cảm ơn.
FROM abc/openjdk:11.0.1
: Chọn image abc/openjdk:11.0.1
từ docker hub, trong trường hợp này là do em muốn image của em có chứa luôn openjdk:11.0.1.
RUN adduser --disabled-password --home /home/app app&& mkdir /home/app/logs && chown app:app /home/app/logs
: Chạy câu lệnh add user (hình như em thiếu username bccs3
) không có password, tạo folder /home/app
và /home/app/logs
sau đó phân quyền cho thư mục /home/app/logs
USER bccs3
: Set user name bccs3
làm user mặc định
WORKDIR /home/app
: Chỉ định thư mục chứa các file jar và resource của em
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom"]
: Nêu cách khởi động app của em, ở đây ["java","-Djava.security.egd=file:/dev/./urandom"]
sẽ được dịch thành java -Djava.security.egd=file:/dev/./urandom
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Input your email to receive reset password link, or if you remember your password, you can click