Skip to content

Error: No such container:path: layer-container:layer.zip #2

@zmzlois

Description

@zmzlois

After running chmod +x ./generate_base_layer.sh
and then compiled by ./generate_base_layer.sh
Terminal return the error like this:

[+] Building 0.0s (1/2)                                                                                                                                                                                                      
 => [internal] load build definition from Dockerfile                                                                                                                                                                    0.0s
 => => transferring dockerfile: 2B                                                                                                                                                                                      0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount2762656469/Dockerfile: no such file or directory
Unable to find image 'base-layer:latest' locally
docker: Error response from daemon: pull access denied for base-layer, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

I have tried to run them both in Linux terminal and VS Terminal, also logged in to my Docker Desktop, but nothing seems to work. I wonder why? Also when I searched for enable WS2 option I couldn't find it in my setting.

Does anyone know how to resolve this issue?

My generate_base_layer.sh file looks like this:

# Generates a base layer for the Lambda functions.

# Remove the container first (if it exists).
docker rm layer-container

# Build the base layer.
docker build -t base-layer .

# Rename it to layer-container.
docker run --name layer-container base-layer

# Copy the generated zip artifact so our CDK can use it.
docker cp layer-container:layer.zip . && echo "Created layer.zip with updated base layer."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions