hello all. hope my question isnt being repeated many time.
I'm attempting to refer to a rust library in gitlab through git as a private repo. as far as i guess, gitlab publishing deploy token should actually work for git clone as a plain url.
(an example is: mylib = { git = "https://gitlab+deploy-token-123456:s0mepa33w0rd@gitlab.com/some_group/some_project"}
)
it works well using git clone but not as cargo dependencies with git. Is there anything critical i have missed?
the message is as below
Updating git repository `https://gitlab+deploy-token-123456:s0mepa33w0rd@gitlab.com/some_group/some_project`
error: failed to get `some_project` as a dependency of package `app v0.1.0 (/home/app)`
Caused by:
failed to load source for dependency `some_project`
Caused by:
Unable to update https://gitlab+deploy-token-123456:s0mepa33w0rd@gitlab.com/some_group/some_project
Caused by:
failed to clone into: /usr/local/cargo/git/db/some_project-24f6264e39ed1a73
Caused by:
process didn't exit successfully: `git fetch --force --update-head-ok 'https://gitlab+deploy-token-123456:s0mepa33w0rd@gitlab.com/some_group/some_project' 'refs/heads/master:refs/remotes/origin/master'` (exit code: 128)
--- stderr
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab+deploy-token-123456:s0mepa33w0rd@gitlab.com/some_group/some_project/'
I'm using docker image with Dockerfile as below:
FROM rust:latest AS build
RUN apt-get update && \
apt-get install musl-tools -y && \
rustup target add x86_64-unknown-linux-musl && \
mkdir /home/app
WORKDIR /home/app
COPY ./cargo/config /usr/local/cargo/config
COPY Cargo.toml Cargo.toml
RUN mkdir src/ && \
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
RUSTFLAGS=-Clinker=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl && \
rm -f /home/app/target/x86_64-unknown-linux-musl/release/deps/app*
the build fail at cargo build
.