Skip to content

Commit

Permalink
fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
fqjony committed Oct 2, 2024
1 parent 1c98c8c commit 11a78cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ RUN ARCH=$(uname -m) && \
./aws/install && \
rm -rf awscliv2.zip aws /tmp/* /var/tmp/*

# Install Azure CLI (architecture-aware)
RUN curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-archive-keyring.gpg && \
# Install Azure CLI with manual GPG key retrieval as root
ENV GNUPGHOME=/root/.gnupg
RUN mkdir -p $GNUPGHOME && \
chmod 700 $GNUPGHOME && \
gpg --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF && \
gpg --export EB3E94ADBE1229CF | tee /usr/share/keyrings/microsoft-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/azure-cli.list && \
apt-get update && \
apt-get install -y --no-install-recommends azure-cli=2.63.0-1~noble && \
Expand All @@ -80,8 +84,10 @@ RUN groupadd -g ${GID} ${USER} && \
# Switch to the user directory
WORKDIR /home/${USER}

# Create necessary directories and set permissions
RUN mkdir -p /home/${USER}/etc /home/${USER}/.cd/configs && \
# Create necessary directories and set permissions for GPG and other files
RUN mkdir -p /home/${USER}/.gnupg && \
chmod 700 /home/${USER}/.gnupg && \
mkdir -p /home/${USER}/etc /home/${USER}/.cd/configs && \
chown -R ${USER}:${USER} /home/${USER}

# Copy the bin, etc, and lib directories
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ build:
@echo "Building Docker image..."
@if [ "$(MULTIPLATFORM)" = "true" ]; then \
echo "Building Docker image for multiple platforms..."; \
docker buildx build --platform linux/amd64,linux/arm64 -t $(DOCKER_IMAGE) --push .; \
docker buildx build --platform linux/amd64,linux/arm64 -t $(DOCKER_IMAGE) .; \
else \
echo "Building Docker image for the local platform..."; \
docker build -t $(DOCKER_IMAGE) .; \
Expand Down

0 comments on commit 11a78cc

Please sign in to comment.