dpl icon indicating copy to clipboard operation
dpl copied to clipboard

Add a docker provider (draft)

Open svenfuchs opened this issue 5 years ago • 6 comments

svenfuchs avatar Aug 30 '19 14:08 svenfuchs

Is the image name argument really required?

See https://github.com/travis-ci/dpl/issues/867#issuecomment-524594611.

I've been doing successful deployments just using docker build -t $TAG and docker push $TAG.

mfrancis95 avatar Oct 15 '19 14:10 mfrancis95

@mfrancis95 makes sense. i have removed the requirement.

would you be able to test this out? ideally in a real-world deployment usecase?

deploy:
- provider: docker
   edge:
     branch: sf-docker

svenfuchs avatar Oct 16 '19 12:10 svenfuchs

@svenfuchs I tested it out. When image is not included, docker build . --no-cache -t gets run without a tag, making the deployment fail. I think in this case the target should be used in its place.

mfrancis95 avatar Oct 18 '19 07:10 mfrancis95

Hello,

I’m new to travis-ci and CI/CD, I’ve tried this patch nevertheless.

I guess your --context option (defined as the Path or URL to the Dockerfile context) merges two docker ideas: the context and the Dockerfile. Dockerfile being at the root of the context is only the default behaviour and DPLv2 does not seem to provide any workaround if this is not the case. Docker provides the possibility to define the Dockerfile we want to use (through the --file/-f option): this option should be available in DPLv2. Also, since there are so many options in docker build, providing an “extra” way to define options could be considered.

Another thing that bothers me a little is the image and target. I am no expert of docker but the way it is used in DPLv2 makes me think image like an intermediate temporary argument. Because only target will be pushed (and therefore visible). This needs to be confirmed but only one dest info could be used alongside the docker build -t ${dest} …, and no need to docker tag anymore. Maybe this is also the reason why @mfrancis95 did try without including image (I don’t know :)).

Thanks you!

Edit: I guess the docker wording is registry, repository, tag.

TotoGaz avatar Nov 06 '19 16:11 TotoGaz

Another point, in my logs I could read docker login --username [secure] --password 9Wp*****************. Is legit to exhibit the first 3 characters of the password?

TotoGaz avatar Nov 06 '19 17:11 TotoGaz

Might need to use the --password-stdin flag.

mfrancis95 avatar Nov 06 '19 18:11 mfrancis95