Skip to content

Commit 79bbfb3

Browse files
authored
Change Dockerfile to use public AL ECR (#115)
Move away from busybox and towards AmazonLinux for compliance reasons. This does increase image size from ~100MB to ~189MB. In future, we want to move to `scratch`, which brings in no extras, which will reduce to ~50MB, but for now, this should suffice. Tested with EKS cluster and confirmed metrics are produced. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 2bc5766 commit 79bbfb3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/actions/artifacts_build/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,23 @@ runs:
6565
- name: Set up Docker Buildx
6666
uses: docker/setup-buildx-action@v3
6767

68-
- name: Login to AWS ECR
68+
- name: Login to private AWS ECR
6969
if: ${{ inputs.push_image == true || inputs.push_image == 'true' }}
7070
uses: docker/login-action@v3
7171
with:
7272
registry: ${{ inputs.image_registry }}
7373
env:
7474
AWS_REGION: ${{ inputs.aws-region }}
7575

76+
# Per https://docs.aws.amazon.com/AmazonECR/latest/public/docker-pull-ecr-image.html, it is possible to
77+
# make unauthorized calls to get public ECR images (needed to build the ADOT Python docker image), but
78+
# it can fail if you previously authenticated to a public repo. Adding this step to log out, so we
79+
# ensure we can make unauthenticated call. This is important for making the pr_build workflow run on
80+
# PRs created from forked repos.
81+
- name: Logout of public AWS ECR
82+
shell: bash
83+
run: docker logout public.ecr.aws
84+
7685
- name: Build and push image according to input
7786
uses: docker/build-push-action@v5
7887
with:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ADD aws-opentelemetry-distro/ ./aws-opentelemetry-distro/
1717

1818
RUN mkdir workspace && pip install --target workspace ./aws-opentelemetry-distro
1919

20-
FROM busybox
20+
FROM public.ecr.aws/amazonlinux/amazonlinux:minimal
2121

2222
COPY --from=build /operator-build/workspace /autoinstrumentation
2323

0 commit comments

Comments
 (0)