Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CO-3527: Fix build for nonRoot user #199

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM katalonstudio/ubuntu-20.04:5bd48bc
FROM katalonstudio/ubuntu-20.04:2e53833

# common environment variables
ARG TARGETPLATFORM
Expand Down Expand Up @@ -32,15 +32,17 @@ ARG IS_PRODUCTION
# RUN mkdir -p $KATALON_KATALON_SCRIPT_DIR
WORKDIR $KATALON_KATALON_SCRIPT_DIR

COPY ./src/scripts/setup.sh setup.sh
COPY --chown=appuser:appuser ./src/scripts/setup.sh setup.sh
RUN chmod a+x setup.sh

# Main setup
RUN $KATALON_KATALON_SCRIPT_DIR/setup.sh $TARGETPLATFORM
RUN sudo $KATALON_KATALON_SCRIPT_DIR/setup.sh $TARGETPLATFORM

# Set locale
ENV LANG C.UTF-8

RUN env

COPY ./src/scripts/katalon-execute.sh katalon-execute.sh
RUN chmod a+x katalon-execute.sh
COPY ./src/scripts/katalon-notify.sh katalon-notify.sh
Expand Down
2 changes: 1 addition & 1 deletion src/Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ARG IS_PRODUCTION
# RUN mkdir -p $KATALON_KATALON_SCRIPT_DIR
WORKDIR $KATALON_KATALON_SCRIPT_DIR

COPY ./src/scripts/setup-slim.sh setup-slim.sh
COPY --chown=appuser:appuser ./src/scripts/setup-slim.sh setup-slim.sh
RUN chmod a+x setup-slim.sh

# Main setup-harden
Expand Down
9 changes: 5 additions & 4 deletions src/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ echo "Install Mozilla Firefox"
apt -y install firefox
# Install 'pulseaudio' package to support WebRTC audio streams
apt -y install pulseaudio
echo "$(firefox -version)" >> $KATALON_VERSION_FILE
# echo "$(firefox -version)" >> "${KATALON_VERSION_FILE}"
echo "$(firefox -version)" >> /katalon/version

if [ "$TARGETPLATFORM" == "linux/amd64" ]; then
echo "Install Google Chrome"
Expand All @@ -33,11 +34,11 @@ fi
# symlink Google Chrome
symlink="/usr/bin/google-chrome"
if [ -L $symlink ]; then
unlink $symlink
sudo unlink $symlink
fi

if [ -f /opt/google/chrome/google-chrome ]; then
ln -s /opt/google/chrome/google-chrome $symlink
sudo ln -s /opt/google/chrome/google-chrome $symlink
fi

# copy scripts
Expand Down Expand Up @@ -91,7 +92,7 @@ rm $katalon_package
mv $KATALON_KATALON_INSTALL_DIR_PARENT/$katalon_unzipped_directory $KATALON_KATALON_INSTALL_DIR
chmod u+x $KATALON_KATALON_INSTALL_DIR/katalonc
chmod -R u+x $KATALON_KATALON_INSTALL_DIR/configuration/resources/drivers
echo "Katalon Studio $version" >> $KATALON_VERSION_FILE
sudo echo "Katalon Studio $version" >> $KATALON_VERSION_FILE

chmod -R 777 $KATALON_ROOT_DIR
chmod -R 777 $KATALON_KATALON_INSTALL_DIR
Expand Down