question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker build contexts

See original GitHub issue

I’m not sure what the right answer to this problem is, but here’s the situation I am in. We have a Dockerized PHP application. We deploy it as pods with two containers: one running php-fpm, the other running nginx with a fastcgi_proxy. As far as I know, this is the best way to put a PHP application into Kubernetes.

An example directory structure:

myrepo.git
├── containers
│   └── proxy
│       ├── Dockerfile
│       └── nginx.conf
├── public
├── src
│       └── ...
└── Dockerfile

And the nginx proxy’s Dockerfile:

# ./containers/proxy/Dockerfile
FROM nginx:1.13-alpine

COPY ./nginx.conf /etc/nginx/nginx.conf

RUN mkdir -p /srv/public
COPY ../../public /srv/public

WORKDIR /srv

The problem is that, currently, I have to build that Dockerfile with its context as the repository root (in order to copy in the ./public folder). Forge defaults the build context as ./containers/proxy, where I need it to be ./

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
rhscommented, Aug 31, 2017

Ok, this feature should be available now as of 0.2.16. You can check out the docs here: https://forge.sh/reference/service-descriptor

0reactions
tristanpemblecommented, Aug 28, 2017

I think ignoring makes sense, just needs to be documented. Gives new users the magic experience but lets you override it if/when necessary

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker build - Docker Documentation
The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in...
Read more >
Understanding the Docker Build Context (Why You Should ...
The Docker build context refers to the files and directories that will be available to the Docker engine when you run docker build...
Read more >
Reduce Build Context for Docker Build Command - Baeldung
The Docker build context consists of files or folders located at the particular path or URL. During the build, those files are sent...
Read more >
3 Different Ways to Provide Docker Build Context - CloudBees
When talking about Docker builds, context means the source directory used when building the container. To explain this a bit better, let's look ......
Read more >
Dockerfiles : building Docker images automatically II (FROM ...
The build context will be sent to the Docker daemon before building the image, which means if you use / as the source...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found