Skip to content

Instantly share code, notes, and snippets.

@saintaardvark
Created October 27, 2015 17:28
Show Gist options
  • Save saintaardvark/7a496fc694c627acf824 to your computer and use it in GitHub Desktop.
Save saintaardvark/7a496fc694c627acf824 to your computer and use it in GitHub Desktop.
FROM ubuntu:trusty
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-transport-https curl
# chef-stable.list can be found here: https://gist.github.com/saintaardvark/ce7700054e573fe9bd14
COPY assets/chef-stable.list /etc/apt/sources.list.d/chef-stable.list
RUN /bin/bash -c '/usr/bin/curl https://packagecloud.io/gpg.key | /usr/bin/apt-key add -'
# This command comes from the apt cookbook for Chef: https://github.com/chef-cookbooks/apt/blob/master/providers/repository.rb#L196-L202
RUN /bin/bash -c "apt-get update -o Dir::Etc::sourcelist='sources.list.d/chef-stable.list' -o Dir::Etc::sourceparts='-' -o APT::Get::L\
ist-Cleanup='0'"
RUN apt-get update
@saintaardvark
Copy link
Author

Output when running "docker build --no-cache .":

Step 5 : RUN apt-get update
 ---> Running in 225ba1a8c745
Ign http://archive.ubuntu.com trusty InRelease
Hit https://packagecloud.io lucid InRelease
Hit http://archive.ubuntu.com trusty-updates InRelease
Hit http://archive.ubuntu.com trusty-security InRelease
Hit http://archive.ubuntu.com trusty Release.gpg
Get:1 https://packagecloud.io lucid/main Sources
Hit http://archive.ubuntu.com trusty Release
Get:2 https://packagecloud.io lucid/main amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/main Sources
Hit http://archive.ubuntu.com trusty-updates/restricted Sources
Hit http://archive.ubuntu.com trusty-updates/universe Sources
Hit http://archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/universe amd64 Packages
Hit http://archive.ubuntu.com trusty-security/main Sources
Hit http://archive.ubuntu.com trusty-security/restricted Sources
Hit http://archive.ubuntu.com trusty-security/universe Sources
Hit http://archive.ubuntu.com trusty-security/main amd64 Packages
Hit http://archive.ubuntu.com trusty-security/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty-security/universe amd64 Packages
Hit http://archive.ubuntu.com trusty/main Sources
Hit http://archive.ubuntu.com trusty/restricted Sources
Hit http://archive.ubuntu.com trusty/universe Sources
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/universe amd64 Packages
Fetched 704 B in 6s (116 B/s)
W: Failed to fetch https://packagecloud.io/chef/stable/ubuntu/dists/lucid/main/source/Sources  Hash Sum mismatch

W: Failed to fetch https://packagecloud.io/chef/stable/ubuntu/dists/lucid/main/binary-amd64/Packages  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100

If I change that first line to "FROM ubuntu:vivid", everything works.

@saintaardvark
Copy link
Author

If I comment out the last line ("RUN apt-get update"), then run a shell in the resulting Docker container, I can see some interesting files in /var/lib/apt/lists/partial:

# cat packagecloud.io_chef_stable_ubuntu_dists_lucid_main_binary-amd64_Packages
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidRange</Code><Message>The requested range is not satisfiable</Message><RangeRequested>bytes=32385-</RangeRequested>\
<ActualObjectSize>32385</ActualObjectSize><RequestId>B6B5652168DD7DC5</RequestId><HostId>aSdvoykys7j0ouAWthsR0a3f8XefvRBKQnu31vWESeUt/\
UUdFrv+Ukg75Al6iEWuolpeUA0iUN0=</HostId></Error>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment