Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Lint: Support ARG before FROM #120

Closed
avluis opened this issue Sep 1, 2017 · 3 comments
Closed

Docker Lint: Support ARG before FROM #120

avluis opened this issue Sep 1, 2017 · 3 comments

Comments

@avluis
Copy link

avluis commented Sep 1, 2017

Support for using ARG before a FROM command was added in 17.05 | issue | pr | doc |

Would love for lint to stop screaming at me for making use of this 馃挃

capture-combined

Sample Dockerfile

ARG CODE_VERSION=5.6-apache
FROM php:$CODE_VERSION

LABEL name="PHP-CI Bundle" \
version=$CONT_IMG_VER \
maintainer="Luis E Alvarado <no-reply@avnet.ws>" \
description="PHP environment for CI"

ARG CODE_VERSION
ARG CONT_IMG_VER
ENV CONT_IMG_VER=${CONT_IMG_VER:-v0.1}

CMD php -v

Can be built with the following commands:

  • docker build -f php-ci\Dockerfile -t php-ci:5.6-apache php-ci
PS C:\git\docker-images> docker run --rm -it -p 80:80 php-ci:5.6-apache
PHP 5.6.31 (cli) (built: Aug  3 2017 23:01:30)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
  • docker build --build-arg CODE_VERSION=7.0-fpm -f php-ci\Dockerfile -t php-ci:7.0-fpm php-ci
PS C:\git\docker-images> docker run --rm -it -p 80:80 php-ci:7.0-fpm
PHP 7.0.23 (cli) (built: Aug 31 2017 19:01:37) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
  • docker build --build-arg CODE_VERSION=7.1-apache -f php-ci\Dockerfile -t php-ci:7.1-apache php-ci
PS C:\git\docker-images> docker run --rm -it -p 80:80 php-ci:7.1-apache
PHP 7.1.8 (cli) (built: Aug  4 2017 18:55:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
@rcjsuen
Copy link
Contributor

rcjsuen commented Sep 1, 2017

Thank you for the bug report, @avluis! I have opened projectatomic/dockerfile_lint#85 to track the error that you are seeing against the dockerfile_lint project.

You shouldn't see this error anymore in the next release of the vscode-docker extension though.

@rcjsuen
Copy link
Contributor

rcjsuen commented Sep 16, 2017

Hi @avluis, this shouldn't be flagged as an error anymore with the new 0.0.17 release.

@avluis
Copy link
Author

avluis commented Sep 17, 2017

@rcjsuen Thank you for the prompt fix! Had a VS Code update and refreshed to grab this update as well.
All looks well from my end 馃樆

@avluis avluis closed this as completed Sep 17, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants