how can I give create a user with sudo privilages while creating an image using oraclelinux:7-slim image

37 Views Asked by At

I want to create a user with sudo privilages using oracleLinux:7-slim.In the Dockerfile I am using the below code,when I am building an image using this Dockerfile it is failing while creating the user:

FROM oraclelinux:7-slim

RUN yum -y install sudo

RUN useradd -m john && echo "oracle:oracle" | chpasswd && adduser oracle sudo

USER oracle

Note:The above line of code is working if am using ubuntu as a base image instead of oraclelinux:7-slim

Is there a way I can create a user with sudo privileges using oracleLinux:7-slim as a base image?

0

There are 0 best solutions below