Skip to content

Commit

Permalink
Use ENV key=value in Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesfernandez committed Aug 12, 2024
1 parent b27e970 commit 418d633
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ ARG host_gid=1001
ARG BUILD_NEW_TEMPLATE

# Set up a local mirror
ENV LOCAL_MIRROR /source_mirror/sources/$version
ENV LOCAL_MIRROR=/source_mirror/sources/$version
RUN mkdir -p $LOCAL_MIRROR

# Add user "geniux" to sudoers. Then, the user can install Linux packages in the container.
ENV USER_NAME geniux
ENV USER_NAME=geniux
RUN echo "${USER_NAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER_NAME} && \
chmod 0440 /etc/sudoers.d/${USER_NAME}

Expand All @@ -46,8 +46,8 @@ RUN sed -i -r 's/ulimit \-Hn/ulimit \-n/g' /etc/init.d/docker
# By default, docker runs as root. However, Yocto builds should not be run as
# root, but as a normal user. Hence, we switch to the newly created user geniux.
USER $USER_NAME
ENV BUILD_INPUT_DIR /home/$USER_NAME/yocto/input
ENV BUILD_OUTPUT_DIR /home/$USER_NAME/yocto/output
ENV BUILD_INPUT_DIR=/home/$USER_NAME/yocto/input
ENV BUILD_OUTPUT_DIR=/home/$USER_NAME/yocto/output
RUN mkdir -p $BUILD_INPUT_DIR $BUILD_OUTPUT_DIR

RUN sudo usermod -aG docker $USER_NAME && newgrp docker
Expand Down
4 changes: 2 additions & 2 deletions base-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ RUN which dash &> /dev/null && (\

# Set the locale to en_US.UTF-8, because the Yocto build fails without any locale set.
RUN locale-gen en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

4 changes: 2 additions & 2 deletions base-image/Dockerfile2
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ RUN which dash &> /dev/null && (\

# Set the locale to en_US.UTF-8, because the Yocto build fails without any locale set.
RUN locale-gen en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

4 changes: 2 additions & 2 deletions base-image/Dockerfile3
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ RUN which dash &> /dev/null && (\

# Set the locale to en_US.UTF-8, because the Yocto build fails without any locale set.
RUN locale-gen en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

0 comments on commit 418d633

Please sign in to comment.