Imagem do docker criada:
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ export MYREPO=raphaelcollab/stunner
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ sudo docker build -t $MYREPO/nexus .
[+] Building 71.6s (29/29) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.79kB 0.0s
=> [internal] load metadata for docker.io/library/debian:bookworm-20240701-slim 0.0s
=> [internal] load metadata for docker.io/hexpm/elixir:1.17.2-erlang-27.0.1-debian-bookworm-20240701-slim 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 1.31kB 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 158.99kB 0.0s
=> [stage-1 1/6] FROM docker.io/library/debian:bookworm-20240701-slim 0.0s
=> [builder 1/17] FROM docker.io/hexpm/elixir:1.17.2-erlang-27.0.1-debian-bookworm-20240701-slim 0.1s
=> [stage-1 2/6] RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates && apt-get clean && rm -f /var/lib/apt/lists/*_* 9.4s
=> [builder 2/17] RUN apt-get update -y && apt-get install -y build-essential git pkg-config libssl-dev && apt-get clean && rm -f /var/lib/apt/lists/*_* 28.4s
=> [stage-1 3/6] RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen 1.5s
=> [stage-1 4/6] WORKDIR /app 0.1s
=> [stage-1 5/6] RUN chown nobody /app 0.2s
=> [builder 3/17] WORKDIR /app 0.0s
=> [builder 4/17] RUN mix local.hex --force && mix local.rebar --force 2.1s
=> [builder 5/17] COPY mix.exs mix.lock ./ 0.1s
=> [builder 6/17] RUN mix deps.get --only prod 2.9s
=> [builder 7/17] RUN mkdir config 0.2s
=> [builder 8/17] COPY config/config.exs config/prod.exs config/ 0.1s
=> [builder 9/17] RUN mix deps.compile 27.5s
=> [builder 10/17] COPY priv priv 0.0s
=> [builder 11/17] COPY lib lib 0.1s
=> [builder 12/17] COPY assets assets 0.1s
=> [builder 13/17] RUN mix assets.deploy 6.6s
=> [builder 14/17] RUN mix compile 0.7s
=> [builder 15/17] COPY config/runtime.exs config/ 0.1s
=> [builder 16/17] COPY rel rel 0.0s
=> [builder 17/17] RUN mix release 1.4s
=> [stage-1 6/6] COPY --from=builder --chown=nobody:root /app/_build/prod/rel/nexus ./ 0.4s
=> exporting to image 0.6s
=> => exporting layers 0.5s
=> => writing image sha256:a0e0d292a593181591b1e354c7c5364717e1043cd2fd21acb8f7d3673ed8372d 0.0s
=> => naming to docker.io/raphaelcollab/stunner/nexus
Desconectado e conectado:
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker logout
Removing login credentials for https://index.docker.io/v1/
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker login -u raphaelcollab
Tag docker criada: ( erro docker push "negado: acesso solicitado ao recurso foi negado" )
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker tag docker.io/raphaelcollab/stunner/nexus:latest docker.io/raphaelcollab/stunner/nexus
Tentou enviar para o repositório do docker:
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker push docker.io/raphaelcollab/stunner/nexus
Using default tag: latest
The push refers to repository [docker.io/raphaelcollab/stunner/nexus]
0603097560bf: Preparing
b5a39b1ed0d7: Preparing
6ecbac9c9860: Preparing
49d482126ff0: Preparing
c5a36b2dc9a4: Preparing
32148f9f6c5a: Waiting
denied: requested access to the resource is denied
SO: Ubuntu 24.04
Adendo 1: Saída de docker login -u:
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker login -u
raphaelcollab
i Info → A Personal Access Token (PAT) can be used instead.
To create a PAT, visit https://app.docker.com/settings
Password:
Login Succeeded
(base) raphy@raohy:~/.talos/stunner/apps/nexus$
Adendo 2:
Este é o repositório que criei no docker:
Adendo 3:
Só posso criar um repositório chamado stunner e não stunner/nexus
E quando eu envio para docker.io/raphaelcollab/stunner/nexus:latest meu acesso é negado:
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker tag
raphaelcollab/stunner/nexus:latest raphaelcollab/stunner/
nexus:latest
(base) raphy@raohy:~/.talos/stunner/apps/nexus$ docker push docker.io/raphaelcollab/stunner/nexus:latest
The push refers to repository [docker.io/raphaelcollab/stunner/nexus]
0603097560bf: Preparing
b5a39b1ed0d7: Preparing
6ecbac9c9860: Preparing
49d482126ff0: Preparing
c5a36b2dc9a4: Preparing
32148f9f6c5a: Waiting
denied: requested access to the resource is denied
Como fazer isso funcionar?
O repositório Docker Hub usa o formato
<org-or-user-namespace>/<repo-name>:<tag>
Parece que
docker.io/raphaelcollab/stunner/nexus
o repositório não existe. Você deve primeiro criar explicitamentedocker.io/raphaelcollab/stunner/nexus repo
e, em seguida, marcarE então tente empurrar novamente
Em outras palavras, você precisa criar
raphaelcollab/stunner/nexus
um repositório ou enviar com comandodocker push docker.io/raphaelcollab/stunner:latest