From fc6aef4305672d19c4ef0f092c13cd05c48fd14f Mon Sep 17 00:00:00 2001 From: abdurawoof Date: Mon, 30 Dec 2024 17:26:49 +0530 Subject: [PATCH] added -o for gid and given internal hostname --- .github/workflows/catalog.yml | 2 +- docker/Dockerfile | 40 +++++++++++++++++------------------ docker/feedscatalog.xml | 6 +++--- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/catalog.yml b/.github/workflows/catalog.yml index 3675ce2..325dc3e 100644 --- a/.github/workflows/catalog.yml +++ b/.github/workflows/catalog.yml @@ -90,7 +90,7 @@ jobs: export NEW_IMAGE_URI="583275065488.dkr.ecr.us-east-2.amazonaws.com/catalog:$IMAGE_TAG" echo "NEW_IMAGE_URI=$NEW_IMAGE_URI" >> $GITHUB_ENV - docker build --build-arg TOKEN=${{ secrets.TOKEN }} -f docker/Dockerfile -t test-catalog:$IMAGE_TAG . + docker build -f docker/Dockerfile -t test-catalog:$IMAGE_TAG . docker tag test-catalog:$IMAGE_TAG $NEW_IMAGE_URI diff --git a/docker/Dockerfile b/docker/Dockerfile index dca5582..48fb862 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,15 +11,15 @@ ARG GIT_URL=https://github.com/rackerlabs/cloudfeeds-catalog.git # ARG GIT_BRANCH="feature_containerization" #ARG GIT_BRANCH="CF-3592-EC2-Image-Builder" ARG GIT_BRANCH="CF-test-ci/cd" -ARG TOKEN - -RUN mkdir -p /home/cl && \ - cd /home && \ - git clone -b ${GIT_BRANCH} https://${TOKEN}@${GIT_URL#https://} cl +# ARG TOKEN # RUN mkdir -p /home/cl && \ # cd /home && \ -# git clone -b ${GIT_BRANCH} ${GIT_URL} cl +# git clone -b ${GIT_BRANCH} https://${TOKEN}@${GIT_URL#https://} cl + +RUN mkdir -p /home/cl && \ + cd /home && \ + git clone -b ${GIT_BRANCH} ${GIT_URL} cl # ======================== Build cloudfeeds catalog using maven container image ======================= @@ -70,25 +70,25 @@ ENV SAXON_HOME=/etc/saxon \ SERVICE_PORT=${SERVICE_PORT:-$service_port} # add non privileged user -RUN GID=1000; \ - while getent group $GID > /dev/null; do GID=$((GID+1)); done && \ - groupadd --gid $GID feeds && \ - UID=1000; \ - while getent passwd $UID > /dev/null; do UID=$((UID+1)); done && \ - useradd -u $UID -g feeds feeds && \ - mkdir -p /etc/cloudfeeds/translation/ && \ - chown -R feeds:feeds "${CATALINA_HOME}" /etc/cloudfeeds/translation/ && \ - wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 && \ - chown feeds:feeds /usr/local/bin/dumb-init && \ - chmod u+x /usr/local/bin/dumb-init - -# RUN groupadd --gid 1000 feeds && \ -# useradd -u 1000 -g feeds feeds && \ +# RUN GID=1000; \ +# while getent group $GID > /dev/null; do GID=$((GID+1)); done && \ +# groupadd --gid $GID feeds && \ +# UID=1000; \ +# while getent passwd $UID > /dev/null; do UID=$((UID+1)); done && \ +# useradd -u $UID -g feeds feeds && \ # mkdir -p /etc/cloudfeeds/translation/ && \ # chown -R feeds:feeds "${CATALINA_HOME}" /etc/cloudfeeds/translation/ && \ # wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 && \ # chown feeds:feeds /usr/local/bin/dumb-init && \ # chmod u+x /usr/local/bin/dumb-init + # added -o flag infront on --gid and -u +RUN groupadd -o --gid 1000 feeds && \ + useradd -o -u 1000 -g feeds feeds && \ + mkdir -p /etc/cloudfeeds/translation/ && \ + chown -R feeds:feeds "${CATALINA_HOME}" /etc/cloudfeeds/translation/ && \ + wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 && \ + chown feeds:feeds /usr/local/bin/dumb-init && \ + chmod u+x /usr/local/bin/dumb-init WORKDIR ${CATALINA_HOME} diff --git a/docker/feedscatalog.xml b/docker/feedscatalog.xml index aa253e4..b9418a8 100644 --- a/docker/feedscatalog.xml +++ b/docker/feedscatalog.xml @@ -4,7 +4,7 @@ And the parameter values will be changed according to the env. --> - https://abdu7511.internal.test.aws.cloudfeeds.rackspace.net - https://abdu7511.internal.test.aws.cloudfeeds.rackspace.net - https://abdu7511.internal.test.aws.cloudfeeds.rackspace.net + https://abdu7511.innternal.test.aws.cloudfeeds.rackspace.net + https://abdu7511.innternal.test.aws.cloudfeeds.rackspace.net + https://abdu7511.innternal.test.aws.cloudfeeds.rackspace.net