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

Docker images based on alpine linux #2988

Open
fliiiix opened this issue Nov 9, 2022 · 8 comments
Open

Docker images based on alpine linux #2988

fliiiix opened this issue Nov 9, 2022 · 8 comments

Comments

@fliiiix
Copy link

fliiiix commented Nov 9, 2022

Is your feature request related to a problem? Please describe.
I can not use the official docker image to run my gitlab ci job.

I have a gitlab job which looks like this:

.matrix_template: &matrix_template
  matrix:
    - IMAGE: ubuntu-bionic-cloudinit
      URL: https://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-amd64.ova
    - IMAGE: ubuntu-focal-cloudinit
      URL: https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64.ova

variables:
  GOVC_URL: XXX
  GOVC_USERNAME:XXX
  GOVC_PASSWORD: ${VSPHERE_PASSWORD}
  GOVC_DATACENTER: XXX
  GOVC_DATASTORE: XXX
  GOVC_CLUSTER: XXX
  GOVC_RESOURCE_POOL: XXX
  GOVC_NETWORK: XXX
  GOVC_FOLDER:XXX
  GOVC_INSECURE: 'true'

 get-images:
   stage: download
   image: galaad991/govc:0.24.0
   parallel:
     <<: *matrix_template
   script:
    - echo "Downloading public image [${IMAGE}-${TAG}]"
    - govc vm.destroy ${IMAGE}-${TAG} || true
    - govc import.ova -name ${IMAGE}-${TAG} -folder vm/${GOVC_FOLDER} ${URL}
    - govc vm.markastemplate ${IMAGE}-${TAG}

This wont work with the minimal official docker image, because export and things like echo are not supported.

Describe the solution you'd like
A image based on a minimal linux distro for example alpine would be great.

Describe alternatives you've considered
The current way of providing environment is -e but I guess it is obvious from the example here that it does not scale.

Something like this:

script:
  - -e GOVC_URL=XXX -e GOVC_USERNAME=XXX -e GOVC_PASSWORD=${VSPHERE_PASSWORD} -e GOVC_DATACENTER=XXX -e GOVC_DATASTORE=XXX -e GOVC_CLUSTER=XXX -e GOVC_RESOURCE_POOL=XXX -e GOVC_NETWORK=XXX -e GOVC_FOLDER=XXX -e GOVC_INSECURE='true' vm.destroy ${IMAGE}-${TAG}
@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2022

Howdy 🖐   fliiiix ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Mark as fresh by adding the comment /remove-lifecycle stale.

@fliiiix
Copy link
Author

fliiiix commented Feb 11, 2023

/remove-lifecycle stale

@github-actions
Copy link
Contributor

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Mark as fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2023
@fliiiix
Copy link
Author

fliiiix commented Jun 13, 2023

/remove-lifecycle stale

@Fredouye
Copy link

Hi

it would be very useful to have an Alpine based image, for GitLab CI pipelines for example (where a shell is required).

This Dockerfile :

FROM vmware/govc:v0.37.0 as govc

FROM alpine:3.19.1

COPY --from=govc /govc /bin/govc

RUN apk update && \
    apk upgrade

CMD ["/bin/sh"]

Results in a 25 Mb image, compared to the 15 Mb of vmware/govc image.

Could it be an option to keep the current image based on scratch, and add a govc-dev image based on Alpine ?

Thanks in advance.

@fliiiix
Copy link
Author

fliiiix commented Apr 18, 2024

I mean i always thought of it as an additional image and the thing im doing
https://github.com/fliiiix/govc-alpine/tree/main results in a https://hub.docker.com/layers/l33tname/govc-alpine/v0.37.0/images/sha256-4fa63e890f83c143dba05beaaaa641c7ecfe1106dd3a444a4a386c17678e4d68?context=repo ~17mb compressed image according to docker hub

but i would love that this would be just part of the official options

@atc0005
Copy link
Contributor

atc0005 commented Apr 18, 2024

RUN apk update && \
    apk upgrade

This may be relevant:

Specifically:

The --no-cache option allows to not cache the index locally, which is useful for keeping containers small.

Literally it equals apk update in the beginning and rm -rf /var/cache/apk/* in the end.

@tenthirtyam tenthirtyam self-assigned this Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants