Last active
July 12, 2024 07:50
-
-
Save ipmb/a8213fb459c27178f88dda7149c35be2 to your computer and use it in GitHub Desktop.
amazon-ssm-agent Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.12-alpine as builder | |
ARG VERSION=2.3.930.0 | |
RUN set -ex && apk add --no-cache make git gcc libc-dev curl bash && \ | |
curl -sLO https://github.com/aws/amazon-ssm-agent/archive/${VERSION}.tar.gz && \ | |
mkdir -p /go/src/github.com && \ | |
tar xzf ${VERSION}.tar.gz && \ | |
mv amazon-ssm-agent-${VERSION} /go/src/github.com/amazon-ssm-agent && \ | |
cd /go/src/github.com/amazon-ssm-agent && \ | |
echo ${VERSION} > VERSION && \ | |
gofmt -w agent && make checkstyle || ./Tools/bin/goimports -w agent && \ | |
make build-linux | |
FROM alpine | |
RUN set -ex && apk add --no-cache sudo ca-certificates && \ | |
adduser -D ssm-user && echo "ssm-user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ssm-agent-users && \ | |
mkdir -p /etc/amazon/ssm | |
COPY --from=builder /go/src/github.com/amazon-ssm-agent/bin/linux_amd64/ /usr/bin | |
COPY --from=builder /go/src/github.com/amazon-ssm-agent/bin/amazon-ssm-agent.json.template /etc/amazon/ssm/amazon-ssm-agent.json | |
COPY --from=builder /go/src/github.com/amazon-ssm-agent/bin/seelog_unix.xml /etc/amazon/ssm/seelog.xml | |
CMD ["/usr/bin/amazon-ssm-agent"] |
Excellent! Thank you for this. I was close to writing something similar to get this running on Flatcar.
Hi! Sorry for the dumb question, but do you have any suggestion on the way it should be run? I was thinking about mounting my $HOME/.aws, but appart from this I'm a bit clueless
Can this be used to run an ssm agent locally? for local application development.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated as per aws/amazon-ssm-agent#140 (comment)