Adding some updates to make the containers more secure, fix the password bug, and add the first version of the Powershell containers
This commit is contained in:
1 parent
0a9767d001
commit
55143adcf6
7 files changed
+193
-218
No files matched your search
+5
-12
@@ -17,24 +17,19 @@ RUN dnf update -y && dnf install -y \
|
||||
&& git lfs install \
|
||||
&& curl -fsSL https://code-server.dev/install.sh | sh
|
||||
|
||||
RUN useradd -u 1000 coder && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
||||
|
||||
RUN ARCH="$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')" \
|
||||
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
|
||||
&& chown root:root /usr/local/bin/fixuid \
|
||||
&& chmod 4755 /usr/local/bin/fixuid \
|
||||
&& mkdir -p /etc/fixuid \
|
||||
&& printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
||||
RUN useradd -u 1000 coder
|
||||
|
||||
COPY code-server.tar.gz /tmp
|
||||
COPY settings.json /tmp
|
||||
COPY config.yaml /tmp
|
||||
COPY project-creator.py /tmp
|
||||
COPY entrypoint.sh /usr/bin
|
||||
|
||||
ARG WPILIB_DL_URL
|
||||
ARG WPILIB_FILE_NAME=wpilib.tar.gz
|
||||
|
||||
RUN curl -fsSL ${WPILIB_DL_URL} -o /tmp/${WPILIB_FILE_NAME} \
|
||||
RUN chown 750 /usr/bin/entrypoint.sh \
|
||||
&& curl -fsSL ${WPILIB_DL_URL} -o /tmp/${WPILIB_FILE_NAME} \
|
||||
&& tar -xzf "/tmp/${WPILIB_FILE_NAME}" -C /tmp \
|
||||
&& WPILIB_ARTIFACTS="$(find /tmp -type f -name 'WPILib_Linux-*-artifacts.tar.gz' -print)" \
|
||||
&& ARTIFACTSYEAR="$(echo $WPILIB_ARTIFACTS | cut -d '-' -f 2 | cut -d '.' -f 1)" \
|
||||
@@ -66,8 +61,6 @@ RUN curl -fsSL ${WPILIB_DL_URL} -o /tmp/${WPILIB_FILE_NAME} \
|
||||
&& su -c "cp -f /tmp/settings.json /home/coder/.local/share/code-server/User" "coder" \
|
||||
&& su -c "sed -i 's/###YEAR###/$ARTIFACTSYEAR/g;' /home/coder/.local/share/code-server/User/settings.json" "coder" \
|
||||
&& su -c "cp -f /tmp/config.yaml /home/coder/.config/code-server" "coder" \
|
||||
&& NEW_PASS="$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 20; echo)" \
|
||||
&& su -c "sed -i 's/PASSWORD/$NEW_PASS/g;' /home/coder/.config/code-server/config.yaml" "coder"\
|
||||
&& su -c "cp -f /tmp/project-creator.py /home/coder" "coder" \
|
||||
&& for EXTENSION in /home/coder/wpilib/$ARTIFACTSYEAR/vsCodeExtensions/*.vsix; do su -c "code-server --install-extension $EXTENSION" "coder"; done
|
||||
|
||||
@@ -76,6 +69,6 @@ EXPOSE 8080
|
||||
USER coder
|
||||
ENV USER=coder
|
||||
WORKDIR /home/coder
|
||||
ENTRYPOINT ["/usr/bin/code-server", "--bind-addr", "0.0.0.0:8080", "."]
|
||||
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user