Skip to content

Commit

Permalink
feat: user 1001
Browse files Browse the repository at this point in the history
This is the one used in the builder image
  • Loading branch information
squakez committed Jun 20, 2023
1 parent 4b45846 commit 661f8ae
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
10 changes: 5 additions & 5 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ ENV MAVEN_OPTS="${MAVEN_OPTS} -Dlogback.configurationFile=${MAVEN_HOME}/conf/log
ADD build/_maven_output ${MVN_REPO}
ADD build/_kamelets /kamelets

RUN chgrp -R 0 ${MVN_REPO} \
&& chmod -R g=u ${MVN_REPO} \
RUN chgrp -R 1001 ${MVN_REPO} \
&& chown -R 1001 ${MVN_REPO} \
&& chgrp -R 0 /kamelets \
&& chmod -R g=u /kamelets \
&& chgrp -R 0 ${MAVEN_HOME} \
&& chmod -R g=u ${MAVEN_HOME}
&& chgrp -R 1001 ${MAVEN_HOME} \
&& chown -R 1001 ${MAVEN_HOME}

USER 1000
USER 1001

ADD build/_output/bin/kamel /usr/local/bin/kamel
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/apache/camel-k/v2/pkg/apis/camel v0.0.0
github.com/apache/camel-k/v2/pkg/client/camel v0.0.0
github.com/apache/camel-k/v2/pkg/kamelet/repository v0.0.0
github.com/container-tools/spectrum v0.6.21
github.com/container-tools/spectrum v0.6.23
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/fsnotify/fsnotify v1.6.0
github.com/gertd/go-pluralize v0.2.1
Expand Down Expand Up @@ -100,7 +100,7 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-containerregistry v0.13.0 // indirect
github.com/google/go-containerregistry v0.15.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:z
github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo=
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
github.com/container-tools/spectrum v0.6.21 h1:gWdwHPpwH9xlZkUVcuJTBhP7EL/1DH2whIgjB/aOlxw=
github.com/container-tools/spectrum v0.6.21/go.mod h1:d8DzKzN7xh+IlnE2Qm0I4gW1HMxtI3D5Xz40mnYG9+8=
github.com/container-tools/spectrum v0.6.23 h1:WZ1WPqgRVLz0p0pWsrbkLvtgp9t6CaxoEjJX4MTF0FM=
github.com/container-tools/spectrum v0.6.23/go.mod h1:x1C6CNpWUNWCzs3gk/gNXpLG7fpGhTR99aoCaBaz/Ms=
github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k=
github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
Expand Down Expand Up @@ -333,8 +333,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-containerregistry v0.13.0 h1:y1C7Z3e149OJbOPDBxLYR8ITPz8dTKqQwjErKVHJC8k=
github.com/google/go-containerregistry v0.13.0/go.mod h1:J9FQ+eSS4a1aC2GNZxvNpbWhgp0487v+cgiilB4FqDo=
github.com/google/go-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE=
github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q=
github.com/google/go-github/v52 v52.0.0 h1:uyGWOY+jMQ8GVGSX8dkSwCzlehU3WfdxQ7GweO/JP7M=
github.com/google/go-github/v52 v52.0.0/go.mod h1:WJV6VEEUPuMo5pXqqa2ZCZEdbQqua4zAk2MZTIo+m+4=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
Expand Down
7 changes: 1 addition & 6 deletions pkg/controller/build/build_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ var (
)

func newBuildPod(ctx context.Context, c ctrl.Reader, build *v1.Build) (*corev1.Pod, error) {
// TODO we must find a way to run this non-root
var ugfid int64 = 0
var ugfid int64 = 1001
pod := &corev1.Pod{
TypeMeta: metav1.TypeMeta{
APIVersion: corev1.SchemeGroupVersion.String(),
Expand Down Expand Up @@ -264,10 +263,6 @@ func addBuildTaskToPod(build *v1.Build, taskName string, pod *corev1.Pod) {
Name: "HOME",
Value: filepath.Join(builderDir, build.Name),
},
/*corev1.EnvVar{
Name: "MAVEN_USER_HOME",
Value: "/usr/share/maven",
},*/
)

container := corev1.Container{
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/catalog/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func initializeS2i(ctx context.Context, c client.Client, ip *v1.IntegrationPlatf
// Dockfile
dockerfile := string([]byte(`
FROM ` + catalog.Spec.GetQuarkusToolingImage() + `
USER 1000
USER 1001
ADD /usr/local/bin/kamel /usr/local/bin/kamel
ADD /usr/share/maven/mvnw/ /usr/share/maven/mvnw/
ADD ` + defaults.LocalRepository + ` ` + defaults.LocalRepository + `
Expand Down

0 comments on commit 661f8ae

Please sign in to comment.