Skip to content

Cannot use alternate docker build file when building from git repo #14837

@elrac

Description

@elrac

I have a git repo that has two dockerfiles in it. When I attempt to use the alternate dockerfile with -t I get the following error

The Dockerfile (Dockerfile-dev) must be within the build context (/var/folders/22/qk_79ksd4bs7_z_c4p1vkq980000gn/T/docker-build-git278991242)

BUG REPORT INFORMATION

Use the commands below to provide key information from your environment:

docker version:

Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): darwin/amd64
Server version: 1.7.0
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 0baf609
OS/Arch (server): linux/amd64

docker info:

Containers: 22
Images: 373
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 421
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.0.5-boot2docker
Operating System: Boot2Docker 1.7.0 (TCL 6.3); master : 7960f90 - Thu Jun 18 18:31:45 UTC 2015
CPUs: 2
Total Memory: 1.956 GiB
Name: boot2docker
ID: BK3M:3XOE:MICO:QBSK:2ZEP:5UVW:JNJF:GDK6:B4NW:523M:Y2IG:74BE
Debug mode (server): true
File Descriptors: 21
Goroutines: 34
System Time: 2015-07-22T00:16:33.802979003Z    
EventsListeners: 1
Init SHA1:
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker

uname -a:

Darwin mini 13.4.0 Darwin Kernel Version 13.4.0: Wed Mar 18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64 x86_64 i386 Macmini3,1 Darwin

Provide additional environment details (AWS, VirtualBox, physical, etc.):

Running using boot2docker on an OSX machine.

List the steps to reproduce the issue:
1.run the following on the command line

docker build -t shaarli -f Dockerfile-dev https://github.com/elrac/docker-shaarli.git

Describe the results you received:

I get the following error

The Dockerfile (Dockerfile-dev) must be within the build context (/var/folders/22/qk_79ksd4bs7_z_c4p1vkq980000gn/T/docker-build-git278991242)

Describe the results you expected:

I expect it to build using the file Dockerfile-dev in the git repo as the dockerfile.

Provide additional info you think is important:

Metadata

Metadata

Assignees

Labels

kind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shiny

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions