diff --git a/infra/alt-env/build/Dockerfile b/infra/alt-env/build/Dockerfile index fc82349..703b3db 100644 --- a/infra/alt-env/build/Dockerfile +++ b/infra/alt-env/build/Dockerfile @@ -14,16 +14,6 @@ RUN apt-get update && \ lsb-release \ unzip -RUN curl -fsSL 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 && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - docker-ce \ - docker-ce-cli \ - containerd.io - RUN curl https://releases.hashicorp.com/terraform/0.14.0/terraform_0.14.0_linux_amd64.zip -o /tmp/terraform.zip && \ unzip -d /usr/local/bin /tmp/terraform.zip && \ rm /tmp/terraform.zip @@ -34,8 +24,6 @@ COPY known_hosts /root/.ssh/known_hosts RUN mkdir /root/.aws COPY config /root/.aws/config -RUN mkdir /root/.docker - RUN mkdir -p /opt/build COPY run.sh /opt/build/run.sh COPY build_functions.sh /opt/build/build_functions.sh diff --git a/infra/alt-env/build/build_functions.sh b/infra/alt-env/build/build_functions.sh index 52ce13d..0f2eafe 100755 --- a/infra/alt-env/build/build_functions.sh +++ b/infra/alt-env/build/build_functions.sh @@ -10,21 +10,17 @@ setup_credentials() { local ID_RSA_CONTENTS local MAINKEYPAIR_CONTENTS local AWS_CREDENTIALS_CONTENTS - local DOCKER_CONFIG_CONTENTS readonly ID_RSA_CONTENTS=$(echo -n "$1" | jq -r .ID_RSA | base64 --decode) readonly MAINKEYPAIR_CONTENTS=$(echo -n "$1" | jq -r .MAIN_KEY_PAIR | base64 --decode) readonly AWS_CREDENTIALS_CONTENTS=$(echo -n "$1" | jq -r .AWS_CREDENTIALS | base64 --decode) - readonly DOCKER_CONFIG_CONTENTS=$(echo -n "$1" | jq -r .DOCKER_CONFIG | base64 --decode) [[ -n $ID_RSA_CONTENTS ]] [[ -n $MAINKEYPAIR_CONTENTS ]] [[ -n $AWS_CREDENTIALS_CONTENTS ]] - [[ -n $DOCKER_CONFIG_CONTENTS ]] printf -- "$ID_RSA_CONTENTS" >/root/.ssh/id_rsa printf -- "$MAINKEYPAIR_CONTENTS" >/root/.ssh/mainkeypair.pem printf -- "$AWS_CREDENTIALS_CONTENTS" >/root/.aws/credentials - printf -- "$DOCKER_CONFIG_CONTENTS" >/root/.docker/config.json chmod 400 /root/.ssh/id_rsa chmod 400 /root/.ssh/mainkeypair.pem diff --git a/infra/alt-env/build/run.sh b/infra/alt-env/build/run.sh index 22757c3..426f973 100755 --- a/infra/alt-env/build/run.sh +++ b/infra/alt-env/build/run.sh @@ -7,20 +7,12 @@ set +x setup_credentials "$1" set -x -# Start the docker daemon. This is necessary when using the sysbox-runc container runtime rather than mounting docker.sock -dockerd > /var/log/dockerd.log 2>&1 & -sleep 3 - declare -r _PROJECT_NAME='conjob' -declare -r _GIT_REPO='git@github.com:ScottG489/conjob.git' declare -r _TFSTATE_BUCKET_NAME='tfstate-alt-conjob' -#git clone $_GIT_REPO cp -r $_PROJECT_NAME "$_PROJECT_NAME"_build cd "$_PROJECT_NAME"_build -# We don't really need to build the application. The latest changes should have been pushed to docker hub and we aren't trying to deploy with local changes -#build_push_application tf_backend_init $_TFSTATE_BUCKET_NAME "infra/alt-env/tf"