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

Support ECR #194

Merged
merged 2 commits into from
Jul 30, 2019
Merged

Support ECR #194

merged 2 commits into from
Jul 30, 2019

Conversation

ThaoTrann
Copy link
Contributor

@ThaoTrann ThaoTrann commented Jul 25, 2019

#192
Use Amazon ECR credential helper.
Add binaries to kraken-origin, kraken-build-index, can add pre compiled binary (https://github.com/awslabs/amazon-ecr-credential-helper/releases) in Dockerfile
(e.g origin Docker)

FROM debian:9

RUN apt-get update && apt-get install -y curl sqlite3 nginx

RUN mkdir -p -m 777 /var/log/kraken/kraken-origin
RUN mkdir -p -m 777 /var/cache/kraken/kraken-origin
RUN mkdir -p -m 777 /var/run/kraken

ARG USERNAME="root"
ARG USERID="0"
RUN if [ ${USERID} != "0" ]; then useradd --uid ${USERID} ${USERNAME}; fi

COPY ./docker/setup_nginx.sh /tmp/setup_nginx.sh
RUN /tmp/setup_nginx.sh ${USERNAME}

USER ${USERNAME}

COPY ./origin/origin /usr/bin/kraken-origin
COPY ./config /etc/kraken/config
COPY ./nginx/config /etc/kraken/nginx/config
COPY ./localdb/migrations /etc/kraken/localdb/migrations
COPY ./test/tls /etc/kraken/tls

RUN apt-get update && apt-get -y install sudo

# Build amazon-ecr-credential-helper
RUN curl -Lo docker-credential-ecr-login https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.3.1/linux-amd64/docker-credential-ecr-login && chmod +x docker-credential-ecr-login && sudo mv docker-credential-ecr-login /etc/kraken

WORKDIR /etc/kraken

Have one of the AWS credentials https://github.com/awslabs/amazon-ecr-credential-helper#prerequisites.
Add ecr backend support to config map.
eg. build_index

backends:
      - namespace: </.*>
        backend:
          registry_tag:
            address: 123456789012.dkr.ecr.us-west-2.amazonaws.com
            security:
               credsStore: 'ecr-login'

Sync uber kraken to wish kraken
@CLAassistant
Copy link

CLAassistant commented Jul 25, 2019

CLA assistant check
All committers have signed the CLA.

@evelynl94
Copy link
Collaborator

thanks to @Rowern for the fix in makisu repo https://github.com/uber/makisu/tree/master/lib/registry/security
and @ThaoTrann for porting it over.

@evelynl94 evelynl94 merged commit 1f2c8d2 into uber:master Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants