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 implementation does not support named stages

See original GitHub issue

Description

My Multi-Stage Dockerfile does not build when I label my build stages

Steps to reproduce

  • Create a Docker environment with a multi stage build that uses a FROM statement, such as:

FROM node:8 as assets

Observed result

Please provide command output with --debug flag set.

From eb-engine.log: 2020/11/17 00:32:25.164489 [ERROR] An error occurred during execution of command [app-deploy] - [Docker Specific Build Application]. Stop running the command. Error: failed to pull docker image: Command /bin/sh -c docker pull node:8 as assets failed with error exit status 1. Stderr:“docker pull” requires exactly 1 argument.

Expected result

Multi-stage Dockerfile builds allow for named stages, as an example in my Dockerfile:

FROM node:8 as assets

ENV PATH=/app/node_modules/.bin:$PATH
WORKDIR /app/app/static/js/
COPY /app/static/js/package.json .
COPY /app/static/scss/custom.scss ../scss/
RUN npm install
RUN npm install -g sass 
RUN sass /app/app/static/scss/custom.scss /app/app/static/css/style.css --style compressed

...
COPY --from=assets /app/app/static/ /app/app/static/

This issue was reported also on a Stack Overflow Issue.

Our platforms supports Docker 19.03.6-ce, according to our docs (which itself was released earlier in 2020 according to the release notes here, and this functionality has existed since at least 2019, looking at the GitHub PR here

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Amazon Linux 2 / macOS 10.15
  2. EBCLI version: EB CLI 3.19.1 (Python 3.9.0)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jsheldcommented, Nov 19, 2020

We are having our platform team look into this and will get back to you when we have an appropriate resolution. In the meantime, if you remove the named stage, does this work as expected? Also, could you kindly let us know what Beanstalk platform you are using? Thanks.

0reactions
Palakpatel67commented, Nov 20, 2020

thanks for your patience. Currently Elastic Beanstalk does not support multi-stage docker build. We do have plans to support this. I have created a new issue in elastic-beanstalk-roadmap and the elastic beanstalk platform team will pick it up from there. let me know if you have any questions. thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-stage builds - Docker Documentation
By default, the stages are not named, and you refer to them by their integer number, starting with 0 for the first FROM...
Read more >
Compose file build reference - Docker Documentation
Compose file build reference. Compose specification is a platform-neutral way to define multi-container applications. A Compose implementation focusing on ...
Read more >
Advanced Dockerfiles: Faster Builds and Smaller Images ...
Multistage builds feature in Dockerfiles enables you to create smaller container images with better caching and smaller security footprint.
Read more >
Best practices for writing Dockerfiles - Docker Documentation
Best practices for writing Dockerfiles. This document covers recommended best practices and methods for building efficient images.
Read more >
Docker storage drivers
The legacy overlay driver was used for kernels that did not support the “multiple-lowerdir” feature required for overlay2 All currently supported Linux ...
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