Skip to content

Commit

Permalink
Remove debug from the Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-szlapa committed Oct 8, 2024
1 parent 35fb147 commit 0fe1a0c
Showing 1 changed file with 25 additions and 30 deletions.
55 changes: 25 additions & 30 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
FROM ubuntu:24.04
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y upgrade

RUN echo "Dockerfile is running. Installing packages..."
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends jq unzip wget ca-certificates make git curl

# Enable tracing in the build process
RUN set -x && apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get -y upgrade
# Install aws stuff
RUN wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" && \
unzip /tmp/awscliv2.zip -d /tmp/aws-cli && \
/tmp/aws-cli/aws/install && \
rm tmp/awscliv2.zip && \
rm -rf /tmp/aws-cli

# Install utilities and log installation
RUN apt-get -y install --no-install-recommends jq unzip wget ca-certificates make git curl && \
echo "Installed required packages: jq, unzip, wget, ca-certificates, make, git, curl"

# Check installed versions for debugging
RUN jq --version
RUN aws --version
RUN git --version

# Create user and set up environment
RUN useradd -ms /bin/bash cdkuser
RUN chown -R cdkuser /home/cdkuser

# Set work directory and user
WORKDIR /home/cdkuser
USER cdkuser

# Install ASDF and Node.js
RUN git clone https://github.com/asdf-vm/asdf.git /home/cdkuser/.asdf --branch v0.14.1 && \
echo '. /home/cdkuser/.asdf/asdf.sh' >> ~/.bashrc && \
echo '. /home/cdkuser/.asdf/completions/asdf.bash' >> ~/.bashrc && \
echo 'PATH="$PATH:/home/cdkuser/.asdf/bin/"' >> ~/.bashrc
# Install ASDF
RUN git clone https://github.com/asdf-vm/asdf.git /home/cdkuser/.asdf --branch v0.14.1; \
echo '. /home/cdkuser/.asdf/asdf.sh' >> ~/.bashrc; \
echo '. /home/cdkuser/.asdf/completions/asdf.bash' >> ~/.bashrc; \
echo 'PATH="$PATH:/home/cdkuser/.asdf/bin/"' >> ~/.bashrc;

ENV PATH="$PATH:/home/cdkuser/.asdf/bin/:/home/cdkuser/node_modules/.bin"

# Install ASDF plugins and Node.js for debugging
RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git && \
asdf install && asdf reshim nodejs && \
echo "Installed Node.js version via ASDF: $(node --version)"
# Install ASDF plugins
RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

# Remove ruby, python, poetry from asdf install
COPY --chown=cdkuser .tool-versions /home/cdkuser/.tool-versions
RUN sed -i -n '/nodejs/p' /home/cdkuser/.tool-versions

# Debugging - list the contents of home directory
RUN ls -la /home/cdkuser/
RUN asdf install; \
asdf reshim nodejs

# Copy project files and set permissions
# Copy files needed for deployment
COPY --chown=cdkuser packages /home/cdkuser/packages
COPY --chown=cdkuser Makefile /home/cdkuser/
COPY --chown=cdkuser node_modules /home/cdkuser/node_modules
Expand All @@ -49,5 +45,4 @@ COPY --chown=cdkuser package-lock.json /home/cdkuser/
COPY --chown=cdkuser tsconfig.defaults.json /home/cdkuser/
COPY --chown=cdkuser docker/entrypoint.sh /home/cdkuser/

# Set the entrypoint to the debugged script
ENTRYPOINT ["/home/cdkuser/entrypoint.sh"]

0 comments on commit 0fe1a0c

Please sign in to comment.