I have not been able to use the ECR plugin to build a Dockerfile that pulls from debian sources. The Dockerfile is as follows:
FROM python:2.7-buster
EXPOSE 9000
RUN apt-get update && \
apt-get install -y \
ca-certificates \
bash \
collectd \
collectd-utils \
cron \
logrotate \
python-pip && \
rm -rf /var/lib/apt/lists/* && \
pip install collectd signalfx
COPY entrypoint.sh entrypoint.sh
ENV TOKEN=''
ENV REGION=''
ENV ENVIRONMENT=''
ENTRYPOINT [ "./entrypoint.sh" ]
My .drone.yml
is as follows:
kind: pipeline
type: docker
name: default
steps:
- name: publish
image: plugins/ecr
settings:
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
repo: adserver-collectd-proxy
tags:
- latest
- staging
region: us-west-2
registry: 000000000.dkr.ecr.us-west-2.amazonaws.com
trigger:
branch:
- staging
event:
include:
- push
In the output of the build, I get errors like the following:
Step 4/23 : RUN apt-get update && apt-get install -y ca-certificates bash collectd collectd-utils cron logrotate python-pip && rm -rf /var/lib/apt/lists/* && pip install collectd signalfx
---> Running in 48851e1013fe
Err:1 http://security.debian.org/debian-security buster/updates InRelease
Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian buster InRelease
Temporary failure resolving 'deb.debian.org'
Err:3 http://deb.debian.org/debian buster-updates InRelease
Temporary failure resolving 'deb.debian.org'
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package collectd
E: Unable to locate package collectd-utils
E: Unable to locate package cron
E: Unable to locate package logrotate
E: Unable to locate package python-pip
The command '/bin/sh -c apt-get update && apt-get install -y ca-certificates bash collectd collectd-utils cron logrotate python-pip && rm -rf /var/lib/apt/lists/* && pip install collectd signalfx' returned a non-zero code: 100
I’ve been able to ssh into the instance that has my drone runner, and executed a build with the following:
docker run --rm \
-e PLUGIN_TAG=latest \
-e PLUGIN_REPO=octocat/hello-world \
-e DRONE_COMMIT_SHA=d8dbe4d94f15fe89232e0402c6e8a0ddf21af3ab \
-v $(pwd):$(pwd) \
-w $(pwd) \
--privileged \
plugins/ecr --dry-run
This builds correctly and does not have any issues resolving debian.org. Can anybody offer some insight as to why this is happening, and/or how to solve this issue?
I’ve also provided a custom_dns
line in the settings
portion of the ECR with 8.8.8.8
and it also hasn’t worked.
Thank you!