#docker - November 2018

dockerArchived
60 messages

All things docker
Archive: https://archive.sweetops.com/docker/

November 2018
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
Hi People,
does anyone know a good and proper way to remove layers with secrets from a docker image ?
e.g. the only way that this can be done currently is to use multi stage builds or to unset the ENV/ARGS and there's this blog post here that mentions experimental secrets but not for strings https://medium.com/@tonistiigi/build-secrets-and-ssh-forwarding-in-docker-18-09-ae8161d066
TL;DR docker history <docker_images> exposes layers with secrets from build time.
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
@Nikola Velkovski did you look at https://github.com/goldmann/docker-squash
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
Nope, thanks will have a look.
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
i believe it's also possible to squash an image without any thirdparty tools
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
docker build --squash
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
You can also have an internal proxy that you use in your build process
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
that proxy then has the authentication token for github
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
we wrote one for the docker registry to do this
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
so we could pull images without authentication in a trusted environment
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
same concept would apply to github
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
here's the simple service
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
(you'd adapt something like this to proxy github requests instead)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)
Posted just a few days ago... highly relevant
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
Ah yeah, I already read it and posted it yesterday 🙂
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
😃
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
hahah
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
sorry, missed that! you did post it
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
Anyway thanks for the help, I was also under the impression that passing secrets as args is ok
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
luckily I haven't pushed any public images 😅
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
😃
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
so regarding that experimental feature, that would be the cleanest, no?
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
yes
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
tamsky
tamskyalmost 8 years ago(edited)
Has anyone used docker as a test environment for starting/stopping services using their init manager?
I can't figure out why none of the "your-favorite-OS-in-docker" images... support their standard init process / service manager.

None of the vendor images (amazon 1 or 2, ubuntu) include their init system: (upstart, systemd, sysvinit)
[ to their credit, CentOS does includes instructions on how to create your own "Dockerfile for systemd base image" on their dockerhub readme: https://hub.docker.com/_/centos/ ]

my concern is, that without such hoop jumping, native, installed packages that try to install/enable their /etc/init or systemd unit files or /etc/init.d files are going to behave differently than real systems running on the exact same OS.
tamsky
tamskyalmost 8 years ago(edited)
not to mention the OSX support for running systemd is missing (it requires --cap-add=SYS_ADMIN, apparently only on OSX, to allow systemd to mount tmpfs)
cf. https://github.com/moby/moby/issues/30723
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)
is the requirement to use systemd inside of docker or to use systemd to start containers (e.g. like in CoreOS)?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
actually, i'm not quite clear on the problem statement.
tamsky
tamskyalmost 8 years ago
😃 goal I'm trying to work with is that packer treats a docker builder the same as an EC2 builder... assuming they both start with the same OS image.... that systems work as similarly as possible.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
aha, i see
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)
@catdevman does this sound familiar? ☝️
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago(edited)
@catdevman was telling me yesterday that they use packer to build both their AMIs and docker images and using Amazon Linux as base for both.
tamsky
tamskyalmost 8 years ago
thats where I'd like to be 😃
tamsky
tamskyalmost 8 years ago
Thanks Erik.
That sounds close.
@catdevman when you have a moment, I'm interested to hear your strategy for using packer to create both docker images and AMIs
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
fwiw, when we've needed init in containers we've used s6 or dumb-init
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
joshmyers
joshmyersalmost 8 years ago
The folks at Yelp are 👌
catdevman
catdevmanalmost 8 years ago
yeah @tamsky I can share some of that information... the biggest part is that your starting point has to be the same so for us we went with amazon linux and ubuntu. Only problem with this strategy is docker and assuming everything is root and doesn't have sudo which means become for ansible needs to be variable and needs to know what type of build you are doing.
catdevman
catdevmanalmost 8 years ago
@tamsky I have made separate packer files for ami and docker but the ansible playbooks are the same just different variables passed in. if you want to know more we can do pm
tamsky
tamskyalmost 8 years ago
Thanks @catdevman,
that lines up 100% with my starting points (amazonlinux:2, ubuntu:18.04)
and matches where I'm at with packer+ansible.
I'd be interested to share my docker bits and ansible "hacks" that I'm using to remove the differences between container and AMI.

maybe we should have a #ansible channel? @Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
@tamsky sure thing!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 8 years ago
I will create in a few
Nikola Velkovski
Nikola Velkovskialmost 8 years ago(edited)
Hello people! Any recommendations for a a docker centric CI that just builds and uploads images, and utilizes caching
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
because I am losing my s*** with travis ci 😄
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
travis cannot into Docker
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
ahha I knew it ! 😄
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
all pipeline steps are containers
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
soo I was checking out the pricing, and 3 concurent builds which is the pro subscription won't do
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
any idea how will it cost to have let's say 20 concurent builds ?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
you need to discuss that with @Erik Osterman (Cloud Posse), he can provide more info and connect you with the Codefresh guys
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
(Y)
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
Thanks
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 8 years ago
one example how we use our Docker images in Codefresh pipelines https://github.com/cloudposse/github-status-updater#integrating-with-codefresh-cicd-pipelines
Nikola Velkovski
Nikola Velkovskialmost 8 years ago
thanks @Andriy Knysh (Cloud Posse)
erik
erikalmost 8 years ago
set the channel topic: :docker: