Skip to content

Commit

Permalink
sonatype-life edits
Browse files Browse the repository at this point in the history
Signed-off-by: ashnamehrotra <[email protected]>
  • Loading branch information
ashnamehrotra committed Jun 13, 2023
1 parent e175f00 commit a3d6523
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM ubuntu:23.04

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
Expand All @@ -11,20 +11,19 @@ VOLUME /data

# Install required packages
RUN apt-get update && \
apt-get install -y wget tar runc sudo systemd
apt-get install -y wget tar runc sudo systemd apt-transport-https ca-certificates gnupg lsb-release --no-install-recommends

# Install Copa
RUN wget https://github.com/project-copacetic/copacetic/releases/download/v0.2.0/copa_0.2.0_linux_amd64.tar.gz && \
RUN wget -q https://github.com/project-copacetic/copacetic/releases/download/v0.2.0/copa_0.2.0_linux_amd64.tar.gz && \
tar -zxvf copa_0.2.0_linux_amd64.tar.gz && \
cp copa /usr/local/bin/

# Install Docker
RUN apt-get update && \
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN wget -qO- https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install -y docker-ce docker-ce-cli containerd.io
apt-get install -y docker-ce docker-ce-cli containerd.io --no-install-recommends

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
6 changes: 2 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ old_tag=$(echo "$image" | cut -d':' -f2)
new_tag="$old_tag$patched_tag"

# run copa to patch image
sudo copa patch -i "$image" -r /data/"$report" -t "$new_tag" --addr tcp://0.0.0.0:8888

# check copa output
if [ $? -eq 0 ]; then
if copa patch -i "$image" -r /data/"$report" -t "$new_tag" --addr tcp://0.0.0.0:8888;
then
patched_image="$image_no_tag:$new_tag"
echo "::set-output name=patched-image::$patched_image"
else
Expand Down

0 comments on commit a3d6523

Please sign in to comment.