Skip to content

Commit

Permalink
build: fix build issue and minimize image
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbeng committed Aug 21, 2024
1 parent 3e406bd commit f90ceb5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
FROM ubuntu:latest

# Install system dependencies
RUN apt update && apt install -y bash curl jq git make sed ranger vim golang

# Set the working directory
WORKDIR /app
RUN apt update \
&& apt install --no-install-recommends -y bash curl jq git make sed ranger vim golang ca-certificates \
&& export GOPATH=/usr/local/go \
&& export PATH=$GOPATH/bin:$PATH \
&& curl -sSL https://rollkit.dev/install.sh | sh -s v0.13.5 \
&& go clean -modcache \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

# Make sure GOPATH is set
ENV GOPATH /usr/local/go
ENV PATH $GOPATH/bin:$PATH

# Install Rollkit dependencies
RUN curl -sSL https://rollkit.dev/install.sh | sh -s v0.13.5
# Set the working directory
WORKDIR /app

# Install Artela rollup
RUN mkdir -p /app/artela-rollkit
Expand All @@ -27,13 +31,13 @@ WORKDIR /app/artela-rollkit
RUN rollkit toml init

# Edit rollkit.toml config_dir
RUN sed -i 's/config_dir = "artroll"/config_dir = "\.\/\.artroll"/g' rollkit.toml
RUN sed -i 's/config_dir = "artroll"/config_dir = "\/root\/\.artroll"/g' rollkit.toml

# download go pkgs first
RUN go mod tidy
# Copy config
RUN cp -r .artroll /root/.artroll

# Run base rollkit command to download packages
RUN rollkit
RUN rollkit && go clean -modcache

# Keep the container running
CMD tail -F /dev/null

0 comments on commit f90ceb5

Please sign in to comment.