Skip to content
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

Update Dockerfile.linux.amd64 #12

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fe5b486
Update Dockerfile.linux.amd64
Ompragash Aug 26, 2024
f66a70c
Update Dockerfile.linux.amd64
Ompragash Aug 26, 2024
0c6c6d8
Create containers.conf
Ompragash Aug 27, 2024
2239b04
updates
Ompragash Aug 27, 2024
fd14134
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
037b7bd
Update containers.conf
Ompragash Aug 27, 2024
afa59df
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
470c34a
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
1a1cac0
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
9b74d00
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
a15decd
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
6284a20
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
77eae68
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
ea000ef
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
0c3347d
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
a647d11
Update Dockerfile.linux.amd64
Ompragash Aug 27, 2024
62fd3e2
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
a9b19d8
Create storage.conf
Ompragash Aug 28, 2024
f82e696
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
6389303
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
0c9daef
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
3ed4a39
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
df1f04e
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
9b0a833
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
1e41406
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
6903323
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
01d798c
Update containers.conf
Ompragash Aug 28, 2024
31d611c
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
5494432
Update docker.go
Ompragash Aug 28, 2024
a4a3ab3
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
767c858
Update docker.go
Ompragash Aug 28, 2024
2692b23
Update storage.conf
Ompragash Aug 28, 2024
5bb0bd5
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
a057e66
Update storage.conf
Ompragash Aug 28, 2024
15937de
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
ef113de
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
5d0426c
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
bd2c759
Update storage.conf
Ompragash Aug 28, 2024
01bfbd8
Update Dockerfile.linux.amd64
Ompragash Aug 28, 2024
8243a49
Update docker.go
Ompragash Oct 29, 2024
b900f6b
Update docker.go
Ompragash Oct 29, 2024
324a737
Update docker.go
Ompragash Oct 29, 2024
60b0278
Update docker.go
Ompragash Oct 29, 2024
8b0b976
Update Dockerfile.linux.amd64
Ompragash Oct 29, 2024
d6bd21c
Update docker.go
Ompragash Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ func commandInfo() *exec.Cmd {
func commandBuild(build Build) *exec.Cmd {
args := []string{
"bud",
"--storage-driver", "vfs",
"--storage-driver", "overlay",
"--log-level=debug",
"-f", build.Dockerfile,
}

Expand Down Expand Up @@ -336,14 +337,18 @@ func commandTag(build Build, tag string) *exec.Cmd {
target = fmt.Sprintf("%s:%s", build.Repo, tag)
)
return exec.Command(
buildahExe, "tag", "--storage-driver", "vfs", source, target,
buildahExe, "tag",
"--storage-driver", "vfs",
source, target,
)
}

// helper function to create the docker push command.
func commandPush(build Build, tag string) *exec.Cmd {
target := fmt.Sprintf("%s:%s", build.Repo, tag)
return exec.Command(buildahExe, "push", "--storage-driver", "vfs", target)
return exec.Command(buildahExe, "push",
"--storage-driver", "vfs",
target)
}

// helper to check if args match "docker prune"
Expand All @@ -357,7 +362,9 @@ func isCommandRmi(args []string) bool {
}

func commandRmi(tag string) *exec.Cmd {
return exec.Command(buildahExe, "--storage-driver", "vfs", "rmi", tag)
return exec.Command(buildahExe,
"--storage-driver", "vfs",
"rmi", tag)
}

// trace writes each command to stdout with the command wrapped in an xml
Expand Down
32 changes: 28 additions & 4 deletions docker/docker/Dockerfile.linux.amd64
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
FROM quay.io/buildah/stable:v1.36.0
FROM quay.io/buildah/stable:v1.26.0

# Set up the working directory
USER root
COPY docker/docker/storage.conf /etc/containers/storage.conf
COPY docker/docker/containers.conf /etc/containers/containers.conf

# Create necessary directories if they don't already exist
RUN mkdir -p /home/build/.config/containers \
&& mkdir -p /home/build/.local/share/containers/storage/overlay \
&& chown -R build:build /home/build/.local \
&& mkdir -p /home/build/.config/cni \
&& chown -R build:build /home/build/.config \
&& chown :build /etc/containers/containers.conf \
&& chown :build /usr/bin/fuse-overlayfs

# Update the storage.conf and containers.conf for the build user
RUN cp /etc/containers/storage.conf /home/build/.config/containers/storage.conf \
&& cp /etc/containers/containers.conf /home/build/.config/containers/containers.conf \
&& chown build:build /home/build/.config/containers/storage.conf \
&& chown build:build /home/build/.config/containers/containers.conf \
&& echo "export BUILDAH_ISOLATION=rootless" >> /home/build/.bashrc


# Switch back to the non-root build user
USER build
WORKDIR /home/build
RUN export STORAGE_DRIVER=vfs

# Set the necessary environment variables for the build user
ENV XDG_CONFIG_HOME=/home/build/.config
ENV CONTAINERS_CONF=/home/build/.config/containers/containers.conf
ENV CONTAINERS_CONF_OVERRIDE=/home/build/.config/containers/containers.conf

# Add the plugin binary
ADD release/linux/amd64/drone-docker /bin/

# Set the entrypoint to the plugin binary
ENTRYPOINT ["/bin/drone-docker"]
2 changes: 2 additions & 0 deletions docker/docker/containers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[engine]
cgroup_manager = "cgroupfs"
7 changes: 7 additions & 0 deletions docker/docker/storage.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[storage]
driver = "vfs" # or "overlay"
runroot = "/home/build/.local/share/containers/storage"
graphroot = "/home/build/.local/share/containers/storage"

[storage.options]