Skip to content

Commit b96871b

Browse files
committed
Fix user
1 parent 2500bc8 commit b96871b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

libcxx/utils/ci/docker/android-builder.dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ RUN <<EOF
7575
rm -rf tmp
7676
EOF
7777

78+
# Create the libcxx-builder user
79+
RUN sudo useradd --create-home libcxx-builder
80+
WORKDIR /home/libcxx-builder
81+
7882
# Install the Buildkite agent and dependencies. This must be done as non-root
7983
# for the Buildkite agent to be installed in a path where we can find it.
8084
#
@@ -90,7 +94,6 @@ EOF
9094
ENV PATH="${PATH}:/home/libcxx-builder/.buildkite-agent/bin"
9195

9296
# Install Docker
93-
USER root
9497
RUN <<EOF
9598
set -e
9699
curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
@@ -104,12 +107,8 @@ RUN <<EOF
104107
chmod u+s /usr/bin/docker
105108
EOF
106109

107-
# Create the libcxx-builder user
108-
RUN sudo useradd --create-home libcxx-builder
109-
USER libcxx-builder
110-
WORKDIR /home/libcxx-builder
111-
112110
# Setup the Buildkite agent command line to do Android setup stuff first.
111+
USER libcxx-builder
113112
COPY libcxx/utils/ci/vendor/android/container-setup.sh /opt/android/container-setup.sh
114113
ENV PATH="/opt/android/sdk/platform-tools:${PATH}"
115114
CMD /opt/android/container-setup.sh && buildkite-agent start

0 commit comments

Comments
 (0)