Skip to content
This repository was archived by the owner on Mar 24, 2020. It is now read-only.
This repository was archived by the owner on Mar 24, 2020. It is now read-only.

USER instruction appears to be ignored for LCOW #25

Description

@solvingj

Dockerfile

FROM ubuntu:trusty

RUN useradd -ms /bin/bash testuser \
    && printf "testuser:testuser" | chpasswd \
    && adduser testuser sudo \
    && printf "testuser ALL= NOPASSWD: ALL\\n" >> /etc/sudoers

USER testuser
RUN whoami
CMD whoami

Build Log

c:\Users\me\Desktop>docker build . --platform=linux -t dockeruserfail
Sending build context to Docker daemon  103.4kB
Step 1/5 : FROM ubuntu:trusty
 ---> 3b853789146f
Step 2/5 : RUN useradd -ms /bin/bash testuser     && printf "testuser:testuser" | chpasswd     && adduser testuser sudo     && printf "testuser ALL= NOPASSWD: ALL\\n" >> /etc/sudoers
 ---> Using cache
 ---> b86bffa2a6bf
Step 3/5 : USER testuser
 ---> Using cache
 ---> 94849a0d376c
Step 4/5 : RUN whoami
 ---> Using cache
 ---> d63f59ce1c1e
Step 5/5 : CMD whoami
 ---> Using cache
 ---> e35c44ded873
Successfully built e35c44ded873
Successfully tagged dockeruserfail:latest

c:\Users\me\Desktop>docker run dockeruserfail
root

Environment

Version 18.04.0-ce-win62 (17151)
Channel: edge
e0a85f6
Windows 10 Pro for Workstations Insider Preview
1803
17639.1000

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions