-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add git
, git-lfs
, and openssh-client
to the trame
docker container
#184
Comments
@jourdain Maybe we should add a way for users to install needed root dependencies as part of the build? The current @Besler For now, could you try to make a new docker image based off of the trame one that adds these? For instance: FROM kitware/trame
RUN apt-get update && \
apt-get install -y \
git \
git-lfs \
openssh-client && \
rm -rf /var/lib/apt/lists/* Then you can run that docker image instead for building the server. |
Good point on having an I guess the real questions here are:
|
I really apologize for the delay, I will try my best to get back with feedback tonight. |
With just the above, I am unable to authorize the repositories, so I need to mount my ssh keys. I would typically build like such: DOCKER_BUILDKIT=1 docker build --ssh default -t demo . Dockerfile FROM ${BASE}
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
RUN --mount=type=ssh poetry install I believe this is the recommended method for preventing your keys from leaking into the image layers. However, this doesn't work here since we're building through an Now, I did try mounting my keys directly: FROM kitware/trame:glvnd
RUN apt-get update && \
apt-get install -y \
git \
git-lfs \
openssh-client && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p -m 0600 ~/.ssh && \
chown -R trame-user:trame-user ~/.ssh && \
echo "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config && \
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts Command docker run --rm \
-v ~/.ssh:/home/user/.ssh:ro \
-e TRAME_BUILD_ONLY=1 \
-v "$DEPLOY_DIR:/deploy" \
-v "$ROOT_DIR:/local-app" \
ondtrame build launcher venv www But I get permission denied on the keys. I think this is a user error, and I would have to set my keys to Essentially, the
I would imagine not by default, since it is so easy to add to the final image through the
One can also export to a |
@Besler So, even though it isn't shown in the cookiecutter, you can also build your image through a RUN command. Instead of mounting the deploy directory, you would copy it. And then you would run the build command as a COPY --chown=trame-user:trame-user . /deploy
RUN /opt/trame/entrypoint.sh build (Example here). Maybe you can build with the |
@psavery The issue I ran into is that the FROM kitware/trame:glvnd as builder
# Install git, git-lfs, and openssh-client
RUN apt-get update && \
apt-get install -y \
git \
git-lfs \
openssh-client && \
rm -rf /var/lib/apt/lists/*
# Build
COPY --chown=trame-user:trame-user bundles/docker/ /deploy
COPY --chown=trame-user:trame-user . /local-app
RUN mkdir -p -m 0600 ~/.ssh && \
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
RUN --mount=type=ssh mkdir -p /deploy/server && /opt/trame/build.sh
FROM kitware/trame:glvnd as base
COPY --from=builder /deploy/server /deploy/server #!/usr/bin/env bash
CURRENT_DIR=`dirname "$0"`
# Since Mac doesn't come with realpath by default, let's set the full
# paths using PWD.
pushd . > /dev/null
cd $CURRENT_DIR/..
DEPLOY_DIR=$PWD
cd $CURRENT_DIR/../../..
ROOT_DIR=$PWD
popd > /dev/null
DOCKER_BUILDKIT=1 docker build \
--ssh default \
-t myimage \
$ROOT_DIR \
-f $DEPLOY_DIR/Dockerfile.myimage This way there is no |
That solution seems reasonable and indeed we should not ignore the regular docker capabilities. We obviously try to streamline most of what we can, but your solution remains simple and reasonable. |
My apologies! Earlier, I had meant to write |
Is your feature request related to a problem? Please describe.
I have many private python dependencies I specify through the remote git interface as such:
requirements.txt
I currently cannot use them since the
trame
docker container does not containgit
.I get the following output from
build_server.sh
:Describe the solution you'd like
Inclusion of
git
,git-lfs
, andopenssh-client
in the docker container.Inclusion of
openssh-client
and apoetry
target would also be sufficient.Describe alternatives you've considered
poetry
(instead of pip or conda) comes withdulwich
as a python-onlygit
client. This gets aroundgit
andgit-lfs
and can be installed ininitialize.sh
, but does not includessh
.initialize.sh
Maybe I could
wget
binaries of all these packages, drop them in abin
somewhere, and modify my path?Just write my own Dockerfile from scratch, bastardizing the nice setup.
Additional context
N/A
The text was updated successfully, but these errors were encountered: