Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃殌 Feature]: Decreasing container layers #2210

Closed
efeozsoy opened this issue Apr 16, 2024 · 8 comments 路 Fixed by #2212
Closed

[馃殌 Feature]: Decreasing container layers #2210

efeozsoy opened this issue Apr 16, 2024 · 8 comments 路 Fixed by #2212

Comments

@efeozsoy
Copy link

efeozsoy commented Apr 16, 2024

Feature and motivation

In our current structure we had to use docker standalone image and latest version has 126 layers which has blocking us to add new things inside the container and taking a docker and push to aws ecr. It gives "rpc error: code = Unknown desc = failed to register layer: max depth exceeded what does it mean"

Usage example

we are currently planning to add other packages and even automation project inside this image but it blocks to proceed without changing the original project.

Copy link

@efeozsoy, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Apr 16, 2024

Several ARG and ENV lines could probably be grouped in single lines.

Copy link

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

@VietND96
Copy link
Member

If without private info, can you share a sample that you are doing for testing purposes during development?

@efeozsoy
Copy link
Author

we are using codebuild to push to ecr but for example you can make a simple automation project to inject it, also we are downloading python to run automation.

# Use the specified version of the selenium chrome standalone image
FROM selenium/standalone-chrome:123.0

# Set the user to root to install packages
USER root

# Install dependencies necessary for compiling Python
RUN apt-get update && apt-get install -y \
    wget \
    build-essential \
    libssl-dev \
    zlib1g-dev \
    libncurses5-dev \
    libncursesw5-dev \
    libreadline-dev \
    libsqlite3-dev \
    libgdbm-dev \
    libdb5.3-dev \
    libbz2-dev \
    libexpat1-dev \
    liblzma-dev \
    libffi-dev \
    uuid-dev \
    && rm -rf /var/lib/apt/lists/*

# Download and install Python
ENV PYTHON_VERSION=3.10.6

RUN wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz \
    && tar -xzf Python-$PYTHON_VERSION.tgz \
    && cd Python-$PYTHON_VERSION \
    && ./configure --enable-optimizations \
    && make -j 8 \
    && make altinstall \
    && cd .. \
    && rm -rf Python-$PYTHON_VERSION.tgz Python-$PYTHON_VERSION

# Link the python3 binary to python for convenience
RUN ln -s /usr/local/bin/python3.10 /usr/local/bin/python && \
    ln -s /usr/local/bin/pip3.10 /usr/local/bin/pip

# Switch back to the default "seluser" from selenium base image
USER seluser
COPY . /automation/

CMD ["/opt/bin/entry_point.sh"]

it is smth like that i created via chatgpt since i can not provide original codes

@VietND96
Copy link
Member

Ok, that's fine, I also found a command to count the number of layers

$ docker history -q selenium/standalone-chrome:nightly | wc -l
127

Just update something and check this number can be decreased

@VietND96 VietND96 linked a pull request Apr 17, 2024 that will close this issue
8 tasks
@VietND96
Copy link
Member

Below is the image layers count after changing. It will be released in 4.20.0

docker history selenium/base:trunk-20240423 -q | wc -l
29
docker history selenium/hub:trunk-20240423 -q | wc -l
41
docker history selenium/distributor:trunk-20240423 -q | wc -l
38
docker history selenium/router:trunk-20240423 -q | wc -l
37
docker history selenium/sessions:trunk-20240423 -q | wc -l
35
docker history selenium/session-queue:trunk-20240423 -q | wc -l
37
docker history selenium/event-bus:trunk-20240423 -q | wc -l
37
docker history selenium/node-base:trunk-20240423 -q | wc -l
45
docker history selenium/node-chrome:trunk-20240423 -q | wc -l
61
docker history selenium/node-edge:trunk-20240423 -q | wc -l
61
docker history selenium/node-firefox:trunk-20240423 -q | wc -l
58
docker history selenium/node-docker:trunk-20240423 -q | wc -l
37
docker history selenium/standalone-chrome:trunk-20240423 -q | wc -l
72
docker history selenium/standalone-edge:trunk-20240423 -q | wc -l
72
docker history selenium/standalone-firefox:trunk-20240423 -q | wc -l
69
docker history selenium/standalone-docker:trunk-20240423 -q | wc -l
45
docker history selenium/video:ffmpeg-7.0-20240423 -q | wc -l
53

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants