Skip to content

Commit

Permalink
fix multi distro support
Browse files Browse the repository at this point in the history
  • Loading branch information
rferrazz committed Nov 17, 2023
1 parent 401930e commit 42044e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ADD resources/shell-wrapper /usr/bin/shell-wrapper
ADD resources/install_clean /usr/bin/install_clean
ADD resources/yocto-env /opt/tools/yocto-env

RUN install_clean vim git wget curl libncurses5-dev sudo
RUN install_clean vim git wget curl sudo locales

# install vs-code
ENV CODE_VERSION "4.8.0"
Expand All @@ -15,8 +15,6 @@ RUN curl -fL https://github.com/coder/code-server/releases/download/v$CODE_VERSI
ADD resources/code-server.yaml /opt/

# Set the locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
Expand All @@ -30,7 +28,8 @@ RUN install_clean jq @EXTRA_PKGS@
# Expose port 8080 (vs-code) and 8000 (free to play)
EXPOSE 8080
EXPOSE 8000
RUN echo "yoctouser:yoctouser" | chpasswd && adduser yoctouser sudo
RUN grep -Fq sudo /etc/group && usermod -aG sudo yoctouser || usermod -aG wheel yoctouser
RUN echo "yoctouser:yoctouser" | chpasswd
USER yoctouser
CMD shell-wrapper

Expand Down
2 changes: 1 addition & 1 deletion resources/install_clean
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ -n "$(command -v yum)" ]; then
yum -y install $ARGS && yum -y clean all && rm -rf /var/cache
fi

if [ -n "$(command -v apt)" ]; then
if [ -n "$(command -v apt-get)" ]; then
echo "using apt"
apt-get -q update && apt-get -qy install $ARGS \
&& apt-get -qy autoremove \
Expand Down

0 comments on commit 42044e2

Please sign in to comment.