Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

docker build with FROM argument from build argument fails #168

Closed
rn opened this issue Nov 29, 2017 · 1 comment
Closed

docker build with FROM argument from build argument fails #168

rn opened this issue Nov 29, 2017 · 1 comment

Comments

@rn
Copy link
Contributor

rn commented Nov 29, 2017

With a Dockerfile like this:

ARG IMAGE
FROM ${IMAGE}
RUN touch /${IMAGE}

and a docker invocation like this:

docker build -t foo --build-arg IMAGE=alpine:3.6 .

I get an error like this:

Sending build context to Docker daemon

error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.35/build?buildargs=%7B%22IMAGE%22%3A%22alpine%3A3.6%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=69f2bc8de54890341a74adacb2879d17d2248d4ea5261f38a111839f2efdb740&shmsize=0&t=foo&target=&ulimits=null: invalid reference format: repository name must be lowercase

This works fine on Linux and Docker for Mac.

The daemon log only contains:

DEBU[2017-11-29T15:48:51.141496100Z] Calling GET /_ping
DEBU[2017-11-29T15:48:51.144511500Z] Calling POST /session

additional details:

% docker version
Client:
 Version:      master-dockerproject-2017-11-26
 API version:  1.35
 Go version:   go1.8.5
 Git commit:   6476524
 Built:        Sun Nov 26 23:49:40 2017
 OS/Arch:      windows/amd64

Server:
 Version:      master-dockerproject-2017-11-26
 API version:  1.35 (minimum version 1.24)
 Go version:   go1.8.5
 Git commit:   dfe2c02
 Built:        Sun Nov 26 23:53:37 2017
 OS/Arch:      windows/amd64
 Experimental: true

$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 8
Server Version: master-dockerproject-2017-11-26
Storage Driver: windowsfilter (windows) lcow (linux)
 LCOW:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd gelf json-file logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 17046 (17046.1000.amd64fre.rs_prerelease.171118-1403)
Operating System: Windows 10 Pro Insider Preview
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 15.85GiB
Name: DESKTOP-67CQHNQ
ID: Y6AG:7KSS:W6LH:UBBP:QSZ2:WFZJ:LKEC:C23K:ABST:HPRI:XYXE:XMFZ
Docker Root Dir: C:\lcow
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 17
 System Time: 2017-11-29T15:50:13.2774808Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
@rn
Copy link
Contributor Author

rn commented Mar 5, 2018

This now seems to work with:

daemon: 7459e4c
client: c26f37c0

closing

@rn rn closed this as completed Mar 5, 2018
Iristyle added a commit to Iristyle/puppet-agent that referenced this issue Dec 5, 2018
 - There are 2 current issues with building the Alpine based agent
   container in Azure:

   - LCOW doesn't support memory limits on containers and gcc currently
     gets an OOM (out of memory) error during compilation. This issue is
     documented in a few places, notably:

		 docker/for-win#1357
     moby/moby#37296

   - Multi-stage builds aren't fully supported in LCOW, though some
     portions are working. Of note, the following issue is still open:

		 microsoft/opengcs#156

     And other issues have been resolved:

		 microsoft/opengcs#168
     microsoft/opengcs#169

     The LCOW "epic" should eventually be updated when support is complete:

     moby/moby#33850

     It's difficult at this time to tell if the current multi-stage
     support is adequate given the blocking memory problem. It may very
     well be enough.

 - For now, disable the Azure pipelines steps for building until the
   point at which they can be re-enabled.
Iristyle added a commit to Iristyle/puppet-agent that referenced this issue Dec 5, 2018
 - There are 2 current issues with building the Alpine based agent
   container in Azure:

   - LCOW doesn't support memory limits on containers and gcc currently
     gets an OOM (out of memory) error during compilation. This issue is
     documented in a few places, notably:

		 docker/for-win#1357
     moby/moby#37296

   - Multi-stage builds aren't fully supported in LCOW, though some
     portions are working. Of note, the following issue is still open:

		 microsoft/opengcs#156

     And other issues have been resolved:

		 microsoft/opengcs#168
     microsoft/opengcs#169

     The LCOW "epic" should eventually be updated when support is complete:

     moby/moby#33850

     It's difficult at this time to tell if the current multi-stage
     support is adequate given the blocking memory problem. It may very
     well be enough.

 - For now, disable the Azure pipelines steps for building until the
   point at which they can be re-enabled.
Iristyle added a commit to Iristyle/puppet-agent that referenced this issue Dec 5, 2018
 - There are 2 current issues with building the Alpine based agent
   container in Azure:

   - LCOW doesn't support memory limits on containers and gcc currently
     gets an OOM (out of memory) error during compilation. This issue is
     documented in a few places, notably:

		 docker/for-win#1357
     moby/moby#37296

   - Multi-stage builds aren't fully supported in LCOW, though some
     portions are working. Of note, the following issue is still open:

		 microsoft/opengcs#156

     And other issues have been resolved:

		 microsoft/opengcs#168
     microsoft/opengcs#169

     The LCOW "epic" should eventually be updated when support is complete:

     moby/moby#33850

     It's difficult at this time to tell if the current multi-stage
     support is adequate given the blocking memory problem. It may very
     well be enough.

 - For now, disable the Azure pipelines steps for building until the
   point at which they can be re-enabled.
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

1 participant