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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot normalize nothing on docker build #328

Closed
dimensi0n opened this issue May 13, 2024 · 4 comments · Fixed by #358
Closed

Cannot normalize nothing on docker build #328

dimensi0n opened this issue May 13, 2024 · 4 comments · Fixed by #358
Assignees
Labels
bug dependencies Pull requests that update a dependency file dx Developer experience working with onetimesecret

Comments

@dimensi0n
Copy link

When trying to build the docker image I get the following error at stage 24 :

Sending build context to Docker daemon  1.797MB
Step 1/26 : ARG CODE_ROOT=/app
Step 2/26 : ARG ONETIME_HOME=/opt/onetime
Step 3/26 : FROM ruby:3.2-slim-bookworm AS builder
 ---> eb85b3c48fbe
Step 4/26 : ARG PACKAGES="build-essential autoconf m4 sudo"
 ---> Using cache
 ---> a0b9db534d09
Step 5/26 : RUN set -eux &&     apt-get update &&     apt-get install -y $PACKAGES
 ---> Using cache
 ---> 0d949a7e1fcc
Step 6/26 : RUN gem update --system
 ---> Using cache
 ---> da5ba5447853
Step 7/26 : RUN gem install bundler
 ---> Using cache
 ---> 6e23b316d9c9
Step 8/26 : COPY ./bin/entrypoint.sh .
 ---> Using cache
 ---> 4254a931dcf0
Step 9/26 : FROM builder AS container
 ---> 4254a931dcf0
Step 10/26 : ARG CODE_ROOT
 ---> Using cache
 ---> c17369de21fd
Step 11/26 : ARG ONETIME_HOME
 ---> Using cache
 ---> d5ba26659f78
Step 12/26 : LABEL Name=onetimesecret Version=0.13.0
 ---> Using cache
 ---> f589f189ea12
Step 13/26 : ARG PACKAGES="curl netcat-openbsd vim-tiny less redis-tools"
 ---> Using cache
 ---> 64c94b9d3bac
Step 14/26 : RUN set -eux &&     apt-get update &&     apt-get install -y $PACKAGES
 ---> Using cache
 ---> 3a5121079f31
Step 15/26 : RUN echo "Creating directories"
 ---> Using cache
 ---> 0e3e955c9ec1
Step 16/26 : RUN mkdir -p "$CODE_ROOT"
 ---> Using cache
 ---> 6f3006e378db
Step 17/26 : RUN mkdir -p "$ONETIME_HOME/{log,tmp}"
 ---> Using cache
 ---> 5198470606d3
Step 18/26 : WORKDIR $CODE_ROOT
 ---> Using cache
 ---> 23cb3919734f
Step 19/26 : COPY Gemfile ./
 ---> Using cache
 ---> 588baa3b0776
Step 20/26 : RUN bundle install
 ---> Using cache
 ---> 51c625987294
Step 21/26 : RUN bundle update --bundler
 ---> Using cache
 ---> f66c3a3de6ea
Step 22/26 : FROM container
 ---> f66c3a3de6ea
Step 23/26 : ENV RUBY_YJIT_ENABLE=1
 ---> Using cache
 ---> 2f08c2b38d76
Step 24/26 : WORKDIR $CODE_ROOT
cannot normalize nothing

The last line being the most important : cannot normalize nothing.

Steps to reproduce :

  • Clone the repository
  • Navigate into the onetimesecretfolder with cd onetimesecret
  • Run the build with docker build -t onetimesecret .
@delano delano self-assigned this May 15, 2024
@delano delano added bug dependencies Pull requests that update a dependency file dx Developer experience working with onetimesecret labels May 15, 2024
@delano
Copy link
Collaborator

delano commented May 15, 2024

Looks like it's related to the CODE_ROOT ARG. According to the docs, it shouldn't be available after FROM container b/c it's not declared again.

https://docs.docker.com/reference/dockerfile/#understand-how-arg-and-from-interact

I don't see this error locally and we're not getting it in the github action builds. That would indicate some versions of docker behave differently in this scenario.

@dimensi0n Can you:

  1. Try adding ARG CODE_ROOT on the line right after FROM container and building again. If that works for you, I'll update the Dockerfile (if it doesn't I'll need to investigate further).
  2. Share the output from running docker version.

docker version on my local dev machine

$ docker version
Client:
 Cloud integration: v1.0.35+desktop.10
 Version:           25.0.1
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        29cf629
 Built:             Tue Jan 23 23:06:12 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.27.0 (135262)
 Engine:
  Version:          25.0.1
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       71fa3ab
  Built:            Tue Jan 23 23:09:35 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.27
  GitCommit:        a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc:
  Version:          1.1.11
  GitCommit:        v1.1.11-0-g4bccb38
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

@FredRa
Copy link

FredRa commented May 29, 2024

Hi,
got the same issue here, calling Docker Build with ARG Code_Root (sudo docker build -t onetimesecret --build-arg CODE_ROOT .) does not make any difference.

Step 26/29 : WORKDIR $CODE_ROOT
cannot normalize nothing
docker version
Client:
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.22.2
 Git commit:        24.0.7-0ubuntu4
 Built:             Wed Apr 17 20:08:25 2024
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.22.2
  Git commit:       24.0.7-0ubuntu4
  Built:            Wed Apr 17 20:08:25 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.12
  GitCommit:
 runc:
  Version:          1.1.12-0ubuntu3
  GitCommit:
 docker-init:
  Version:          0.19.0
  GitCommit:

Ubuntu Version:

Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

Any Suggestions? Any help would be appreciated.

delano added a commit that referenced this issue May 29, 2024
@delano
Copy link
Collaborator

delano commented May 29, 2024

@FredRa Can you try building from branch 328-cannot-normalize-nothing-on-docker-build.

$ git fetch
$ git checkout 328-cannot-normalize-nothing-on-docker-build
$ docker build -t onetimesecret .

It should be a simple fix. I just can't replicate it locally myself.

@FredRa
Copy link

FredRa commented May 29, 2024

Great, thanks a lot! All 30 steps are now completed

@delano delano linked a pull request May 29, 2024 that will close this issue
delano added a commit that referenced this issue May 30, 2024
…ng-on-docker-build

[#328] Fix for docker arg `$CODE_ROOT`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file dx Developer experience working with onetimesecret
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants